Home » , , » Add shortcode to template file in woocommerce or wordpress

Add shortcode to template file in woocommerce or wordpress

Written By Unknown on Rabu, 30 Oktober 2013 | 02.20

Shortcode API, a simple set of functions for creating macro codes for use in post content. It enables plugin developers to create special kinds of content (e.g. forms, content generators) that users can attach to certain pages. For instance, the following shortcode (in the post/page content) would add a photo gallery into the page:     [gallery]

But this syntax work for only wp-admin post editor. If you want to add shortcode to your template file then you can use

<?php
        echo do_shortcode( '[shortcode_name]' );
 ?>
It will do same work as done by shortcode when it is added to post...
Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger