WordPress.org

Forums

How to use WooCommerce Shortcodes (3 posts)

  1. kcwebz
    Member
    Posted 2 years ago #

    I am looking to used some shortcodes on a new page for my wordpress site.. But I am not sure how to use them, do I need to reference a woocommerce file somewhere on the page? like you do with css files?

    I have tried to add featured products to my home page like this

    [featured_products per_page="12" columns="4"]

    however all it dose is show [featured_products per_page="12" columns="4"] on the page.. not the actual content???

    any help would be appreciated.

  2. XavaIreland
    Member
    Posted 2 years ago #

    If you have a php template, then try

    <?php echo do_shortcode('[featured_products per_page="12" columns="4"]']); ?>

  3. icevincent
    Member
    Posted 1 year ago #

    XavaIreland's code is great, but a little bug, the last bracket is redundant
    It's should be
    <?php echo do_shortcode('[featured_products per_page="12" columns="4"]'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic