Hi, this is the first time I'm using Wordpress for something other than a basic blog so I might be overlooking something very simple.
I'm trying to keep a menu item "portfolio" highlighted on the portfolio page and all pages nested within portfolio.
The Wordpress documentation says to add the "is_tree" function to the 'functions.php' file which I did. I then called it in the menu like this:
But this seems to keep it highlighted on all pages on the site other than the pages nested within portfolio. Am I using is_tree wrong in the above example? Or is there an alternative way to keep the menu item highlighted?
Thanks for any help.
I'm trying to keep a menu item "portfolio" highlighted on the portfolio page and all pages nested within portfolio.
The Wordpress documentation says to add the "is_tree" function to the 'functions.php' file which I did. I then called it in the menu like this:
Code:
<li<?php if (is_tree('portfolio')){ echo " class=\"current\"";}?>><a href="http://domain.com/portfolio/">Portfolio</a></li>
But this seems to keep it highlighted on all pages on the site other than the pages nested within portfolio. Am I using is_tree wrong in the above example? Or is there an alternative way to keep the menu item highlighted?
Thanks for any help.