Dec
22

Create a plugin in wordpress

Creating a plugin in wordpress is just like doing your favorite work with lot of fun.

so lets start to create very simple plugin in wordpress.

steps to create the plugin,

1> create a plugin folder.

for ex, my_first_plugin

2> now create a php file in that folder.

for ex, my_first_plugin\first_plugin.php

3> in this file add header which is the most important part in the plugin development.

/*
Plugin Name: plugin name(first plugin)
Plugin URI: shareprogrammingtips.com
Description: this is my first plugin
Author: Arpi Patel
Version: 1.0
Author URI: shareprogrammingtips.com
*/

this will create your plugin.But this will do nothing.
so lets add some code in the plugin,

4> in the first_plugin.php file write the code,

function first_plugin_function()
{
     echo 'This is my First plugin.';
}
add_action('admin_notices', 'first_plugin_function');
}

You are done with the plugin code.

5> now zip the plugin folder you have just created and add your new created plugin in the wordpress plugin by plugin’s new plugin option.

after activating the plugin you will have the message in the admin area.

This is very simple plugin.We can expand it up to the extend we want.

Have a fun with the plugin code.

 

Arpi

hiii friends… i am doing msc in computer application and information technology. we are here to share our knowledge and idea on shareprogrammingtips.com.

More PostsWebsite

You may like to read this also....

1 Comment to “Create a plugin in wordpress”

  • Karina March 16, 2012 at 5:54 am

    Hi could you tell us what exactly were the steps you have taken to ilsnatl the Like button on your site? Like what plugins you have used? This thing involves certain tasks like getting a key from facebook and using it in the plugin so we need to know what you’ve done before we can troubleshoot. 0Was this answer helpful?

Post comment

*

CommentLuv badge
Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

latest comments

Find us on Facebook

Top Authors

35 posts
saurabh
22 posts
10 posts

Find us on stackoverflow

Polls

Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link