The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Using is_tree for Dynamic Menu (1 post)

  1. mrjohnsly
    Posted 6 years ago #


    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