Want create site? Find Free WordPress Themes and plugins.

Hi there, Today I would like to write a simple tutorial on creating custom shortcode in wordpress and I will show you how to use shortcode in your wordpress.

Shortcodes can be used to increase the functionality of WordPress, whilst saving time on having to manually write code every time you want a specific function to be applied to one of your posts.

Step1:

Add this function below in functions.php file.

function my_shortcode_func($atts){
    return "Hello World!";
}
add_shortcode("hello_world, "my_shortcode_func");

To use this shortcode you may insert this shortcode below inside the content on your post or page.

[hello_world]

Use in Template File:

<?php echo do_shortcode('[hello_world]'); ?>

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – we are here to solve your problems.

Did you find apk for android? You can find new Free Android Games and apps.

Posted by Abhay Kumar

I am Abhay Kumar from New Delhi (India). I'm working as a Web Developer from last 3+ years. You can follow me on Twitter, Facebook or Google+.