Highligh a element of my custom menu while browsing subcategories
-
Hello, I’m buidling a custom php-menu for my template; and one of my category menu is highlighting if we are in a specific category (a “root” category).
<?php }elseif (is_category('13')) { ?> ShowMenu (3); <?php }
But the problem is, that if we are browsing a child-category; this doesn’t work anymore.
So : how can I change my condition and build it to detect the parent category ? (not just 1 level up, because if I have sub-sub-categories, it will broke again)
Thanks !
I’ve read about
<?php the_category(‘separator’, ‘parents’ ); ?>
but it must be in the loop so I can’t use it.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Highligh a element of my custom menu while browsing subcategories’ is closed to new replies.