WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Taxonomies Problem (2 posts)

  1. AbandonedAR Team
    Member
    Posted 10 months ago #

    Ok, so I'm trying to make a custom widget on a product page, and I can get the widget to show up however when I add code like...

    <?php if ( in_category( 'Shirts' )) { ?>
    &bull; Shirts
    <?php } ?>

    The category is not read or printed on the widget. I have tried every possible Taxonomy in place of "in_category" like product_cat, in_product_category, and many others. The selected category is in the product categories. What am I doing wrong?

    I'm using the latest Version of Woocommerce (Version 2.0.14) And here is a link to the an example product on my site. Using Elegant Themes (StyleShop.) http://www.shop.abandonedar.com/product/map-privileges/
    I've done hours of searching, and nothing works. Help is very much appreciated! Thanks in Advance!

    http://wordpress.org/plugins/woocommerce/

  2. mikejolley
    Member
    Plugin Author

    Posted 10 months ago #

    in_category is used for POST categories.

    Use http://codex.wordpress.org/Function_Reference/has_term The taxonomy is called 'product_cat'

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.