Learn How to Create A WordPress Plugin

Beginner’s guide on how to create plugin in wordpress.

WordPress is quite popular in today’s world. Everyday millions of new websites are built in wodpress. Using wordpress, you can create matrimonial sites, job softwares, auction websites etc. It has also been widely used in ecommerce.

Learn How to Create A WordPress Plugin

Step by Step Tutorial on WordPress Plugin Development

If you want more control on your wordpress site, you need to create plugin. Good news is, you can also make good money by creating awesome plugin. Read more on how to earn through plugin. How to Earn with plugin ?

By default, wodpress system works in its limit and you must add plugin in order to get more features. Creating plugin is not an easy task but wordpress makes it easy. It can be built by any beginner in developing area without much effort.

In this tutorial, I will give a step by step description on how to create wodress plugin . You need basic knowledge of php for building plugin.

Lets start : wordpress is built on php, so if you have some basic knowledge of php, you can create your plugin of your own. And you can monalize with it easily. Open your favorite text editor (I use Dreamweaver)and simply add the following code in it.

/* 
    Plugin Name: Myfirst Plugin
    Plugin URI: http://designspicy.com
    Version: 1.0
    Author: Savan Paun 
    Description: Plugin for Easy search all the registered User/Visitor
*/

Understand the code

Plugin name : name of your plugin must be unique.
Plugin URI : plugin developed website name.
Version : plugin version.
Author : developer’s name
Description : some basic details of your plugin.

Now create a folder in wp-content/plugins by name “myplugin” and save this file in it naming plugin.php. Now go to wordpress admin panel and find the plugin click active.
Congratulation your basic plugin is ready. Now create it in advance and add some functions to it.

NOTE: Don’t Ignore the Hook

Your wordpress theme must have two hooks in header and footer. Hook is the most powerful part in wordpress. Without hook, both your wordpress function and plugin will not work.

when you start a wp action, it starts with wp_header and end with wp_footer hook, so without hook your theme or plugin is useless.

I Recommend you to read : How to create slider plugin. How to create Shortcode with plugin.

Lets get started with the basic plugin development. Add some more code in plugin. Once the code is added, you will notice that all images in your themes appear in rounded corner style.

All image rounded corner

add_action('init', 'imagecorner');  
function imagecorner() {  	?>
<style>
body img
{
border: 4px solid #FFF;
position: relative;
border-radius: 4px;
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);
box-shadow: 0px 0px 3px #888;
border-radius: 55px;
}
</style>
<?php
}
?>

This plugin effects all the images in the themes. You can also add your own style in it. This is just an example for the beginners who are interested in learning the process of developing plugin.
Know how to create wordpress theme?

Hide Admin Bar in WordPress

<?php 
add_action('init', 'hideadmin');  
function hideadmin() 
{
add_filter('show_admin_bar', '__return_false');
} ?>

Change all Link colour and hover effect with plugin

add_action('init', 'imagecorner');  
function imagecorner() {  ?>
<style>
body a
{
	color:#FF3300;
}
body a:hover
{
	color:#663300;
}
</style>
<?php } ?>

That’s it!
Create your own plugin and if you have any questions, please leave a comment. I will respond soon.
Final plugin download.

Savan Paun

I am Savan Paun Admin of this blog. I like to write about Wordpress, Design, Development, Plugin, SEO, Blogging and Making Money online. I am a professional blogger based in Jamnagar. I'm always available for beginner who wants to learn.

Comments

Leave a Reply