How To Use WordPress shortcode in theme files


Sponsored Links




Our recent client need some plugin that display the code using shortcode, like we all know, mostly shortcode must be injected or put on post content.

Do Shortcode on WordPress - Victoria Justice At the Teen Vogue Party

Do Shortcode on WordPress - Victoria Justice At the Teen Vogue Party

Sometime we have another problem, we need to use the shortcode but not in Post Content, we need to put it directly in our theme. How To Use this WordPress shortcode? From WordPress Codex.

I got the right solutions. We only need very simple code and the shortcode will be automatically executed, I will give example below.

echo do_shortcode('
		
		
		

');

On this code above, the theme will be executed gallery shortcode. Now you can directly injected shortcode on your theme, whenever you want and you like it.

Pictures Taken from Egotastic

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>