• chris-wetzel

    (@chris-wetzel)


    I have a double scissor-type drop menu, that wouldn’t work with wp-list pages so I’m hardcodeing my navigation. The function is_tree sounded just like what i needed to fix my submenu highlighting problem… but I can’t get it to work *&%$#(@! Can someone help me? Newbee WordPress guy. You can see it here at http://wereorganized.biz/.

    I pasted the is_tree function:

    function is_tree($pid) { // $pid = The ID of the page we’re looking for pages underneath
    global $post; // load details about this page
    if(is_page()&&($post->post_parent==$pid||is_page($pid)))
    return true; // we’re at the page or at a sub page
    else
    return false; // we’re elsewhere
    };

    into my functions.php, ( this isn’t excally as listed in snippit 4,but what others seeemed to be useing )then added this to the list item that contained the nested unordered list of my submenu:

    <li<?php if (is_tree(‘garage-cabinets’)) { echo ” class=\”current\””; } ?>><b>GARAGE CABINETS</b>

    I was expecting the “current” class to be added to any submenu li of garage cabinets, what I got was this error:
    Fatal error: Call to undefined function is_tree() in /home/content/77/5846477/html/wp-content/themes/modern-style/header.php on line 57

    Can you give me a clue as to what I’m doing wrong?

Viewing 1 replies (of 1 total)
  • Hey dude,

    still struggling with this problem?

    I also ran into this problem, its because this function uses an ID instead of an name, try running <?php the_ID(); ?> to find out what id the garage-cabinets has and use it.

Viewing 1 replies (of 1 total)
  • The topic ‘is_tree submenu highlighting’ is closed to new replies.