Archived topic
Hook to display on category + all child cats
5 replies · Started by Berto on October 4, 2019
I registered several new menus and took a short cut to display the menus on categories by using an elements > hook.

Example, the first menu to only be displayed under category 'competitions' - but there is no way to make this display on all child categories, will I need to add additional location rules for every single child category or is there another way around this using elements > hooks?
If there isn't it looks like I will need to move this to the functions file. I thought I would save me some time.
Hi there,
Have you tried opening a child category yet? It's possible that WordPress would show the hook on child categories by default.
If not, we should be able to filter the hook display rules to include child categories.
Let me know :)
Hi Tom,
No, they don't display by default, I have to create additional rules.
Sounds like something we should try to implement in the Display Rules by default.
You mentioned using a function - is that something you're able to write? If so, that's likely the easiest route.
If not, we can create a function which filters the Display Rules, but that will likely be more complex than writing a simple hook with a condition.
Let me know :)
Thanks Tom.
No problem :)