The Short code-API can help to make your Editor more advance especially with the help of Short codes to insert external content to your posts or pages easily. There are many possibilities, an at the bottom of this post there is a list of plugins that you can install to add short codes to your theme if they do not already have them.

But if sometimes you like to use a Short code in your Template or just don’t like to put it in the Editor, for example you like to insert it in the Custom Field or somewhere else. There is a function in WordPress which helps you to insert a short code somewhere else besides your Editor.

The easiest way to ru na short code directly inside one of your theme PHP files is to copy the code below, change out where it says “my_short code” with the short code name and place it where you would like the short code to display

<?php echo do_short code(‘[my_short code]’);?>


Written by