Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to write a basic Plugin in wordpress

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 304
    Comment on it

    Hello reader's today we discuss about "How to write a simple Plugin in wordpress".

    If you want a to write own Plugin in WordPress there are some steps you must follow and these steps are mention below:

    1. Plugin name should be unique(the name should be related to the functionality of the Plugin or what the Plugin will do).
    2. Plugin Files:- Now in next step you should create a PHP file with a name derived from your chosen Plugin name. Again, try to choose a unique name. People who install your Plugin will place this PHP file in their WordPress Plugins directory in installation (usually wp-content/plugins/), so no two Plugins they are using can have the same PHP file name.
    3. Readme File-: It contain the description of your plugin.

    Now write the below code into your php file. below comment contain your Plugin information Author name and Author URL, Plugin version, Plugin URL.

    <?php
    /**
     * Plugin Name: Your Plugin Name
     * Plugin URI: http://evontech.com
     * Description: What your Plugin do
     * Version: 1.0.0
     * Author: Evon Tech
     * Author URI: http://evontech.com
     */
    ?>
    

    Below code defines that how to create a shortcode of your Plugin. social-urls is the shortcode of the Plugin. You can use this short code where you want in your website.

    <?php
    function social_url(){
    <!-- write your code here-->
    <?php
    }
    add_shortcode('social-urls', 'social_url');
    

    How to call Plugin shortcode:-

     <?php echo do_shortcode( '[social-urls]' ); ?>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: