Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #219216

    Not sure if I’m missing something here, but should the top level parent page appear in my side navigation? If you take a look at this page, I would like a link to the parent ‘About Bhutan’ page to appear in the side navigation above all of the child page elements which do appear. Thanks for your help.

    #220394

    Hey davidrk!

    No, by default only the child pages will be displayed. If you want to show the parent page open up enfold/functions-enfold.php and replace

    
                    $sidebar_menu .= $children;
    

    with

    
                    $sidebar_menu .= '<li class="page_item page-item-'.$parent.' current_page_item_parent">';
                    $sidebar_menu .= '<a href="'.get_permalink($parent).'">'.get_the_title($parent).'</a></li>';
                    $sidebar_menu .= $children;
    

    Cheers!
    Peter

    #220405

    Thanks Dude! The Parent page now appears in the side navigation, however when on the Parent page it doesn’t appear in a ‘current’ state as per the other pages. Any ideas on how to correct this?
    Thanks so much!

    #220852

    Hi!

    Try following code:

    
                    $current = ($the_id == $parent) ? 'current_page_item' : 'current_page_item_parent';
                    $sidebar_menu .= '<li class="page_item page-item-'.$parent.' '.$current.'">';
                    $sidebar_menu .= '<a href="'.get_permalink($parent).'">'.get_the_title($parent).'</a></li>';
                    $sidebar_menu .= $children;
    

    Cheers!
    Peter

    #221068

    Perfect! Thank you so much for your help. Really is appreciated.

    #221072

    Sorry – spoke to soon! One more thing, is there a way to achieve the ‘current’ state for a side navigation item for a third level page (parent>child>child)? Please look at this page to see how it currently appears. It has the bold text, but not the shaded background as the parent and first level child pages do when selected.

    Thank you!

    #221348

    I am also looking for this and would like help in how to use the menu LABEL and NOT the menu title field? thanks much!

    NEVERMIND – just realized it ussd page title and has nothing to do with the main menu…duh!

    • This reply was modified 10 years, 10 months ago by bluemoonink.
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Mising 'Parent' from sidebar navigation’ is closed to new replies.