phprockers-logo

Simple way to create a widget in wordpress

First Step: Goto this directory-localhost/yourwordpressname/wp-content/plugins.
Second Step: Create a folder for creating a widget in above directory.

Third Step: Inside the folder, Create a .php file and copy below codes.
Fourth Step: Goto wordpress administrator, see left sidebar, click plugins and activate your plugin.
Fifth Step: Finally Goto wordpress widget  and find the your widget name here. Then you have to use, where you want in widgetized area in wordpress.

<?php


/*
Plugin name: Simple Widget
Description: This is the test for Simple Widget Creation.
Version: 1.0
Author: Ramakrishnan
*/

function simple_widget()
{
echo "This is simple widget";

}
//the following link is used for display widget in admin side
register_sidebar_widget('Simple Widget', 'simple_widget');

?>

1 comment:

  1. I am using that, it is really helpful creating widget.

    ReplyDelete