How to Create WordPress Widget

Creating a wordpress widget can be simple or complex, it depends on what you want to achieve.

First create a widget class.

jQuery is not defined in WordPress 3.4

When I installed WordPress 3.4, my plugins that uses jquery suddenly didn’t work. Here’s how I fixed it. Add these codes on your plugin. {code} add_action(‘wp_head’, ‘load_scripts’); // to load jquery on the font page add_action(‘admin_head’, ‘load_scripts’); // to load jquery on the admin page function load_scripts(){ wp_enqueue_script(‘jquery’); //other scripts } {/code}

Apply a Shortcode within a Shortcode

Suppose that you have two shortcodes,

1. the [RED]content[/RED] – will change the color of the text to red.

1. the [DOTTED]content[/DOTTED] – will add dotted underline to the text.

Add Date Picker to WordPress

To add date picker, specifically jQuery UI Datepicker to wordpress, may it be admin or front page, first add the download jquery.ui.datepicker.js.

Implementing Ajax in WordPress Themes and Plugins

Ajax is very useful when you want to execute a php script within an html without the need to reload the page.

It is easy to implement this within wordpress.

First, create a php function for the actions that will be executed.