List ‘Home’ and children only
-
Hello all,
I have a bit of a problem displaying my navigation properly. I have divided my site into three sections, all operating as different sites, just connected with a static main navigation (Main 1, Main 2 and Main 3) so that users can easily flick between the different ‘sites’. (Like this! Beware the page is a mess)
Then below the static main navigation I list the sub pages using this piece of code:
<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>
It works great but I would like to add a ‘Home’ button (displayed in the same fashion as the sub page links) that will take you to the parent page for each section.
I know I already have my static main buttons displayed but I want to include a ‘Home’ as well, but just can’t figure it out. My php skills aren’t excellent but I have still tried so many versions using the wp_page_menu template but never got it working. Perhaps wp_page_menu isn’t the way to do this?
If anyone have any ideas please let me know!
Oh and I also want it to work with the li.current_page_item a CSS class.
Hope this makes sense and isn’t too complicated… Thanks in advance!
em
- The topic ‘List ‘Home’ and children only’ is closed to new replies.