-
AuthorPosts
-
February 4, 2014 at 8:28 am #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.
February 6, 2014 at 10:21 am #220394Hey 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!
PeterFebruary 6, 2014 at 10:58 am #220405Thanks 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!February 7, 2014 at 11:47 am #220852Hi!
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!
PeterFebruary 7, 2014 at 11:12 pm #221068Perfect! Thank you so much for your help. Really is appreciated.
February 7, 2014 at 11:29 pm #221072Sorry – 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!
February 9, 2014 at 3:20 pm #221348I 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, 9 months ago by bluemoonink.
-
AuthorPosts
- The topic ‘Mising 'Parent' from sidebar navigation’ is closed to new replies.