• Resolved flyntm

    (@flyntm)


    Hi,

    I’m looking for a way to display some of my categories on a page. To be clear, I want to display a list of categories, not the products within the categories.

    I tried [product_category category=”lisa_photo, lisa_paint”] but this displays the products within the categories. I can’t seem to find a way to display the category name and image so the user can select the desired category and then go to that page.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Praveen a11n

    (@spraveenitpro)

    Automattic Happiness Engineer

    Hi @flyntm

    You would like to display the categories on a page, Have you tried something like this: [product_categories], more on this at https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-9

    Cheers!

    Thread Starter flyntm

    (@flyntm)

    I tried this and it displays the products within the category, not the categories themselves.

    Thanks for your attention.

    slash1andy

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    This is the code you would want to use for displaying categories ( this specific one is for top-level cats only) https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-9

    That page has all the info you need to tailor your shortcode

    Thread Starter flyntm

    (@flyntm)

    Thanks for your response. And, this was one of the articles I was using for reference. I have tried all of these shortcodes with these results.

    [product_categories number=”0″ parent=”0″] – Displays all top level categories
    [product_categories] – Displays all categories
    [product_categories category=“category_slug”] – Displays all categories
    [product_category] – Does Nothing
    [product_category category=“category_slug”] – Displays ALLPRODUCTS within the category
    [product_category category=“category_slug1, category_slug2”] – Displays all PRODUCTS within both categories.
    [product_category category=“category_slug1, category_slug2”] – Displays all categories.

    For reference, I only have 3 top-level categories and I want to display just 2 of them.

    Thanks again.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @flyntm Try the [product_categories ids="100,101"] shortcode, replacing the 100,101 with the IDs of the categories you’re wanting to display.

    The IDs of the categories can be found by clicking the link to edit the category, then getting the tag_ID from the address bar:


    Link to image: https://cld.wthms.co/XuMRqt

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Short Codes for Category Display’ is closed to new replies.