Trouble with current category highlight in a menu
-
Hi all,
I’m having trouble trying to highlight one menu item when it’s selected. As you can see in this page:
https://finotratoeventos2.hospedagemdesites.ws/?cat=3
All sub item under the portfolio menu are correctly highlighted when selected, except for the sub item “relacionamentos”.
The problem is that the code that highlights all sub items is the same!
<ul> <li <?php if ( is_page('portfolio') ) { echo 'class="atual"'; } ?> ><a href="index.php?page_id=18">todos</a></li> <?php $catsy = get_the_category(); $myCat = $catsy[0]->cat_ID; $args = array( 'orderby' => 'ID', 'order' => 'ASC', 'style' => 'list', 'child_of' => 9, 'hierarchical' => 1, 'title_li' => '', 'current_category' => $myCat, ); wp_list_categories( $args ); ?> </ul>
I have no idea why it doesn’t work for one particular sub item. Can you please help me?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Trouble with current category highlight in a menu’ is closed to new replies.