• Resolved hielkio

    (@hielkio)


    Hi folks,

    I thought it would be easy to achieve, but not for me unfortunately.
    The shortcode I used is this:
    [product_categories number="62" columns="4" orderby="name" order="ASC"]

    This works fine, but I don’t need / want / like the parent category showing up there ??
    In this case I used the shortcode to get the categories inside a WP page, but when I use the default WOOCommerce link to the category, it doesn’t show the parent, what’s perfect!

    Anyone an idea / solution?
    Thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter hielkio

    (@hielkio)

    Btw, what’s the purpose / value of the parent showing next to the sub-categories?
    If you click on it, you’ll see the same categories as before, but then without the parent. so it’s just a useless category (link) in my opinion

    Strange that nobody mentioned this before ?? Besides a solution, I’d like to invite people to explain the usefulness of displaying the parent category. When clicking the parent category would result in showing all products belonging to the sub-categories makes more sense to me. If that was the case, I would be pleased also ??

    Plugin Support Grigorij S. a11n

    (@grigaswp)

    Hi there,

    The [product_categories] shortcode is designed to display product categories themselves and not products within those categories. Depending on the value provided to the shortcode (changing the value within number=”62″ doesn’t seem to have any effect at all) the top-level category is also displayed.

    If you’d like to only show products within a category or its subcategories and not the categories themselves – perhaps you should try using this shortcode:

    [product_category category=”category-slug-here” columns=”4″ orderby=”name” order=”ASC”]

    Please make sure to replace category-slug-here with an actual slug of your category (found in Products >> Categories >> Your category) and not the number/ID.

    More information can be found here:

    https://docs.woocommerce.com/document/woocommerce-shortcodes/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only show child categories when using shortcode’ is closed to new replies.