WordPress.org

Ready to get started?Download WordPress

Forums

Using is_tree for Dynamic Menu (1 post)

  1. mrjohnsly
    Member
    Posted 4 years ago #

    Hi.

    I've added the is_tree function to the 'functions.php' and I'm calling it into my menu using:

    <li<?php if (is_tree('portfolio')){ echo " class=\"current\"";}?>><a href="http://domain.com/portfolio/">Portfolio</a></li>

    I want this to add class="current" on the portfolio page and the pages nested within portfolio. The problem is, it's adding class="current" on every page on my site apart from the nested pages in portfolio.

    Any help would be greatly appreciated.
    mr.sly x

Topic Closed

This topic has been closed to new replies.

About this Topic