• Resolved l r

    (@lainyrache)


    Hi
    I would like to not show the sidebar on certain pages:
    on sub categories of a particular category and on the main shop page.

    So far I have :
    if (is_product_category('collections')){

    But I don’t know how to identify a parent category or the main shop page.
    Can anyone offer any advice?
    Thanks for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    I believe is_shop() will work for the shop page. I’m not aware of a way to check is a CPT category has a parent or not off the top of my head, so you’ll have to do some digging there I’m afraid.

    Thread Starter l r

    (@lainyrache)

    Thanks for your reply jameskoster!

    I think I’ve now sorted it with the plugin Dynamic Widgets.
    This will let me add different widgets for Blog pages, and totally remove widgets from shop sub-categories. So I’m hopeful this is the solution!

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

The topic ‘If is Parent Category’ is closed to new replies.