[Plugin: Smarter Navigation] smarter-navigation for dynamic menu highlighting
-
Hi Scribu,
This is a really handy plugin. The nex/previous post links work just as I need them to. My question is this: can I use any functions from this plugin to return a string with the name of the referrer (not a link)? So, something like the referrer_link() function already written in, but somehow modify it to return just a string?
The idea is this: I would like to use this string within a conditional tag, to test the referrer for a given post. I’d like to be able to use this to get the dymanic menu highlighting to work. Something along the lines of
if(referrer())='x' {echo " class=\"current_page_item\""; }
a possible snippet from my menu:
<li <?php if(is_category('Paintings' { echo " class=\"current_page_item\""; } ?> <?php elseif(referrer())='Paintings' { echo " class=\"current_page_item\""; } ?>> <a href="/category/paintings"><span>Paintings</span></a> </li>
My problem is that I have posts which belong to multiple categories. If the user links to a single post from a specific category page, I would like the menu tab for that category to stay highlighted (even though the single post may also belong to other categories). So basically, I just need to test the referrer if possible.
Thanks for your help!
- The topic ‘[Plugin: Smarter Navigation] smarter-navigation for dynamic menu highlighting’ is closed to new replies.