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.


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.


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.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Posted by Editorial Staff