Simple Steps to create wordpress plugin

Requirements:
Wordpress (Download)
Xampp (Download)

Note:
Ensure you have local wordpress setup, if not please setup your local wordpress.

Step 1: Create a mywpplugin.php and paste the below code,

[php]
<?php

/*
Plugin Name: Naveendra
Plugin URI: http://www.naveendra.com
Description: My First wordpress Plugin
Author: Naveen kumar
Version: 1.0
Author URI: http://www.ngdeveloper.com
*/

function my_wp_plugin(){
$html = ‘My wordpress Plugin’;
return $html;
}

if(!is_admin())
add_shortcode(‘jd’,’my_wp_plugin’);

?>
[/php]

Step 2: Paste the mywpplugin.php file in
\xampp\htdocs\Naveendra\wordpress\wp-content\plugins

pasting wordpress plugin file

Step 3: After pasting the file in the above location go to admin page,

http://localhost/Naveendra/wordpress/wp-login.php and login with credentials which you created during wordpress setup time.

Dashboard -> Plugins -> Installed plugins, there you can find our plugin as well,

activating my wordpress plugin

Now go to Posts -> Add New and paste,

[plain gutter=”false”]
The text inside my plugin is,

[jd]
[/plain]

Pasting plugin defined codes

Now publish and visit the page, you will be able to see the text which we have given in our plugin page (mywpplugin.php),

my wordpress plugin output

Recommended PHP and WordPress Books:

One comment

  • hello all
    i am trying to create image gallery plugin,for that my plugin will have many pages on it like add gallery, edit gallery and add images for the gallery.
    how can i make my plugin have this three pages and navigate between them.
    please help me
    thank you

Leave a Reply