Shortcodes are written by providing a handler function. Shortcode handlers are broadly similar to WordPress filters: they accept parameters (attributes) and return a result (the shortcode output).
WordPress shortcode are extremely useful, but many people thinks you can’t use them outside of the editor, for example in your template files. But you can, and it’s pretty easy. Just read this tutorial to know how to use WordPress shortcode in a template files.
Simply use the do_shortcode() function anywhere in your theme file. The shortcode you want to use have to be given to the function as shown below:
<?php echo do_shortcode("[example_shortcode]"); ?>
And thats all. Simple and easy .