Tag: Wordpress Plugin

How to develop WordPress plugin tutorial: Widget (step 5 of 5)

nopkinwp-widget.php – Widget

This file is used to create widget function for the plugin.

With this, the plugin is ready to be deployed!

If you want to test the plugin or see the files for yourself, you can download the complete plugin here:

Download Nopkin Hello Plugin

How to develop WordPress plugin tutorial: Shortcode (step 4 of 5)

nopkinwp-shortcode.php – Shortcode function

This page is used to create Shortcode for the plugin.

Once the function has been created, there are two ways to use the Shortcode:

1. Paste the Shortcode inside post/page:
[nopkin_wp display_author=true/false]

2. Call PHP function directly within template files:

How to develop WordPress plugin tutorial: Admin (step 3 of 5)

nopkinwp-admin.php – Admin page

This page is to create admin / settings page. Just for example, there is one input field on the setting, that is, to give font size (in px) to the output text.

How to develop WordPress plugin: Initialise (step 2 of 5)

Plugin file structure

First create the following folders and files.

nopkinwp-hello.php – the main plugin file

This is the main file to define and initialise the plugin. It can be given any name but it is a good practice to give it the same name as your plugin name.

This file defines the plugin giving its name and description, author, version, license information, etc.

Now if you look at WordPress Plugins page, the information you entered above within comments is displayed here.

Next, these are functions to include other required files.

Mysql table
As the main purpose of the plugin is to display “Hello world…” text from mysql table, a mysql table has to be created and text inserted.

The plugin’s main function
Then there is the plugin’s main function, which will be used as shortcode and function call to display “Hello world…”

How to develop WordPress plugin: Introduction (step 1 of 5)

What will the plugin do

This is an example WordPress plugin which will, on installing, a simple mysql table will be created with “Hello world” text. This text can then be displayed on the site via Widget, shortcode or direct function call on a template file. The plugin has all the necessary components like Widget, shortcode, function call, settings page, etc and can be used as a start up to develop more complex plugins.

The plugin is called “Nopkin WP plugin”.

To get the idea of what we will accomplish with this plugin, take a look at the following screenshots:

Wordpress Plugins page

WordPress Plugins page

Setting link

Setting link

Options/Setting page

Options/Setting page

Widget

Widget

Shortcode

Shortcode

Output

Output

Bhutanese Calendar online!

Bhutanese calendar

Bhutanese calendar

Every beginning of a year, Kuensel, or national newspaper releases a year calendar, a Bhutanese calendar which most of us simply love to call it as “Kuensel Calendar” because we do not get Bhutanese calendar from anywhere else.

Not anymore!

I happened to find a repository of Bhutanese calendar dates from years 1600 to 2099 at Open Source Bhutanese Calendar software.

With little knowledge in PHP and some idea on how to present them, I have been able to extract data from years 1900 – 2099 and display them on webpage as monthly and yearly calendar, as well as a conversion formula between Bhutanese and Western dates.

Though the accuracy of the data cannot meaningfully be verified, the author of the open source software has presented all the necessary and credible formulas and algorithms used to generate them. Moreover, I have collected Kuensel calendar from years 2000 to 2014 and verified that every date is accurate.

Another exciting note is that I have developed a WordPress plugin to display a monthly Bhutanese calendar. The plugin can readily be downloaded and installed on your WordPress blog or site. For non-Wordpress website developers, the calendar can be embedded as an iframe.

Visit Bhutanese Calendar here

About me

profileSangay Tenzin
Web Developer, Magento, Concrete5, Wordpress, Shopify, Ecommerce, Website all-rounder, Casual blogger…

Love… Happiness…

Category
Archive
Download

Downloads

Bhutanese Calendar
གནམ་ལོ་ མེ་མོ་བྱ་ལོ།

Fire Female Bird Year 2017

འབྲུག་ཟླ་ བཅུ་པ - བཅུ་གཅིག་པ།

December 2017

ཟླ་བ Sun
མིག་དམར Mon
ལྷག་པ Tue
ཕུར་བུ Wed
པ་སངས Thu
སྤེན་པ Fri
ཉི་མ Sat
 
 
 
 
 
༡༣ 1
༡༤ 2
༡༥ 3
༡༦ 4
༡༧ 5
༡༨ 6
༡༩ 7
༢༠ 8
༢༡ 9
༢༣ 10
༢༤ 11
༢༥ 12
༢༦ 13
༢༧ 14
༢༨ 15
༢༩ 16
༢༩ 17
༣༠ 18
19
20
21
22
23
24
25
26
27
༡༠ 28
༡༡ 29
༡༢ 30
༡༣ 31

Powered by Bhutanese Calendar