There maybe a number of reasons you will need to add a shortcode to your WordPress theme. There are two simple ways we can normally do this. We can paste the shortcode into a post or page, or we can paste our shortcode into our theme files.
The first method is pretty self explanatory so how do we accomplish the second method? Follow the steps below to add a shortcode to your WordPress theme files using PHP.
To display your shortcode simply add the following line of PHP code to the destination you wish to display your shortcode.
<?php echo do_shortcode("[shortcode]"); ?>