Shortcodes are the special tags like [a-shortcode-ex] which replaces the tag with some other content on the frontend. By default shortcode usage is only limited to WordPress posts, pages and custom post types but there is a very easy function in WordPress called do_shortcode() which enables you to use any shortcode with in your theme files, the PHP template files.
For example: WordPress provide you a gallery shortcode which is used by creating and inserting gallery through ‘Add Media’ but you can only use it inside your post types and not in theme files containing PHP code in them. The purpose of this tutorial is to use any shortcode with in theme files.
WordPress has function called do_shortcode(), just add the code as shown below, replacing [example_shortcode] with shortcode you like using in template file.
<?php echo do_shortcode("[example_shortcode]"); ?>