WordPress.org

Ready to get started?Download WordPress

Forums

WP Tiles
[resolved] product category from woocommerce does not work (3 posts)

  1. krolick
    Member
    Posted 10 months ago #

    Hi,

    I have a problem on one of the sites I'm working on.
    I use wp-tiles plugin on one of the subpages perfectgentleman.tv/educatedgentleman in few variations.
    My client wanted it to show different types of wordpress pages in different groups eg. pages in one of the tabs, posts in the other and products from diffferent categories in two or three of them.

    I managed to display posts and pages from different categories but I have a problem with products. When I use the "category" shortcode it does not show any product, but when I try to use "product_cat" instead - all the products published on the site appear. And there should be only one present.

    My shortcode in the "Digital Courses" tab looks like this:

    [wp-tiles posts_query='post_type=product&product_cat=51' template="4InARow" colors="#8f0099, #7d0099"]

    Is it possible for the wp-tiles plugin to work with the product categories just as nicely as it does with the posts and pages?

    Thanks for any info. Justina.

    http://wordpress.org/plugins/wp-tiles/

  2. Mike
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Justina,

    Interesting question! I've been playing with it, and with the current setup, your only option is using a custom tax query. However, arrays (square brackets) are not correctly parsed by the shortcode, so I made it so (in v0.5.5, uploading now), that you can use curly brackets instead.

    Your shortcode would become:

    [wp-tiles posts_query='post_type=product&tax_query{0}{taxonomy}=product_cat&tax_query{0}{field}=id&tax_query{0}{terms}=51' template="4InARow" colors="#8f0099, #7d0099"]

    You could consider changing the field to slug and using the category slug.

    Cheers,
    Mike

  3. krolick
    Member
    Posted 10 months ago #

    Hi Mike,

    Thanks a lot for the info.
    This solution will suit me just fine.
    I'll try it as soon as the update is avaliable in my wordpress administration panel.

    Thanks again,
    Justina

Reply

You must log in to post.

About this Plugin

About this Topic