Hi,
I found my way to highlight my menu and sub-menu when on single post category and sub-category single post.
- ( without plugins / PHP / jQuery ) -
This is not a complcated site, I dont need main-sub-sub sub-sub .... categories ). For that kind of navigation, I would use a Breadcrumb.
My test site has 4 tab :
ACCUEIL ( home page ) - ULTREIA 2011 ( cat 1 ) - ULTREIA 2010 ( cat 2 ) - LES DÉMUNIS ( page 2 )
and 2 sub-category :
GALERIE 2011 ( cat 3 under ULTREIA 2011 ) - GALERIE 2010 ( cat 4 under ULTREIA 2010 )
So, I have a static front page, 4 category, and another page.
Driven by WordPress 3.0.1 and Thesis 1.8, using WordPress menu instead of Thesis menu.
I achived :
First (1) level highlighting ( white ). Second (2) level highlighting ( yellow ). Third (3) level highlighting ( orange )
- 6 lines of css in custom_css -
1 - Highlighting the ( main category Tab ) while on a "single post" of my main category.
.current-post-ancestor a {background: #FFFFFF;border-bottom-color:#FFFFFF;}
2a - Highlighting the ( subcategory ) while on a "single post" of my child/subcategory.
.sub-menu .current-post-ancestor a {background:#F0EEC2;}
2b - Highlighting the ( parent and child category ) while on a child/subcategory. ( need to define a category for the appropriate posts )
.cat_galerie-2010 .current-menu-parent a {background:#F0EEC2;}
.cat_galerie_2011 .current-menu-parent a {background:#F0EEC2;}
3 - Highlighting the ( parent and child category ) while on a "single post" of my child/subcategory. ( need to define a "CSS Class" (post edit) for the appropriate posts ) - here I target a "CSS Class" and it's appropriate menu-item created by WordPress )
.postgalerie2010 .menu-item-776 a {background:#FFD596;}
.postgalerie2011 .menu-item-785 a {background:#FFD596;}
Now, I would like to find a way to highlight my NavBar when on Archive Posts ( multi-post )=( Daily, Tags ).
Can it be possible to target the right Category or Tag for the posts ? ( Posts are given a common name category and a "CSS Class" )
Hope it help others and thanks for any cues.
Pierre