By month: September 2014

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

How to use Dzongkha font on Website

dzongkhaWhile developing my pet project Bhutanese Calendar (WordPress Plugin for Bhutanese Calendar available here) I had to look for a nice Dzongkha font, convert it into web-font and use on the site. I came across a good number of Dzongkha fonts available on various websites like Dzongkha Development Commission and DIT. These are few popular ones:

  • Uchen
  • Wangdi (Joyig)
  • Jomolhari

This is Uchen font: དཔལ་ལྡན་འབྲུག་པ་ཕྱོགས་ལས་རྣམ་རྒྱལ།་ ༡༢༣༤༥༦༧༨༩༠

I have found that the size of most of these Dzongkha font files are too big (more than 1G) to be converted to web fonts, especially the ones downloaded from DIT website. Using big font files unnecessarily adds to load time of the website, which is of course very bad in all respect.

Dzongkha Development Commission and BBS Dzongkha use Uchen and Jomolhari respectively and when I gave a quick test on http://tools.pingdom.com/fpt/ the size of font files is simply appalling, adding significant load time to the websites.

DDC Website

DDC Website

BBS Dzongkha

BBS Dzongkha website

For Bhutanese Calendar, I have used a smaller size Uchen font, which converts to just 32K web-font. If you want to use it click the download link below.

Uchen web font used on Bhutanese Calendar website

Uchen web font used on Bhutanese Calendar website

Download Uchen web font here

Download Dzongkha fonts (Uchen, Tashi, Wangdi, Jomolhari)

CSS not working on IE11

IE_bugIf you find your CSS is not getting rendered as expected and the website looks strange on Internet Explorer 11, just add this within <head>…</head>:

My Babies wishing me Happy Father’s Day : )

Cute is the word….

babies

About me

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

Love… Happiness…

Category
Archive
Download

Downloads

Bhutanese Calendar
གནམ་ལོ་ ས་ཕོ་ཁྱི་ལོ།

Earth Male Dog Year 2018

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

November 2018

ཟླ་བ 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

Powered by Bhutanese Calendar