You are here
Home > Php > How to Create WordPress Plugin

How to Create WordPress Plugin

Hello Friends, Today I am going to show you how to create a WordPress Plugin from scratch. You need to follow the step-to-step instructions which I am going to explain below. The Plugin which I am going to discuss below will add my facebook profile link on bottom of every page and post.

Step 1: Create Folder in WordPress Plugin Folder

First you need to create a folder in WordPress Plugin Folder which you can find at “YOUR_WORDPRESS_INSTALLATION\wp-content\plugins”.  And name of your plugin folder should be unique and name it as your plugin name, in my case it is Test_Plugin.

Step 2: Create Plugin File in Your Plugin Folder

Second is to create a plugin file in your plugin directory. Plugin file name could be PLUGIN_NAME.php , in my it is Test_Plugin.php.

Note: Advance plugin can contain more than one files.

Test_Plugin_File

Step 3: Start Coding

Now we will code the plugin, First thing to develop any wordpress plugin is to define its name, description, version etc. which we define before starting our plugin logic code and it should be defined in comment. like this…

Step 4: Plugin logic code

Now we will code plugin logic

This code will executed every time the content of the page or post is being shown and your_function_name function gets called and this will add my facebook profile url to the end of every post or page.

Test_Plugin

Step 5: Now activate your plugin

Now activate your plugin and see the result on any page or post.

Test_Plugin_Activate

Output

Test_Plugin_Output

 

Thanks

Please share if you like it.

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top