This article was taken from WP Engineer: http://wpengineer.com/display-always-subpages-in-sidebar/ In this article I want to show an example in which are the main pages in a horizontal navigation. The related sub-pages are displayed in the sidebar when you click on the main page. For better understanding we take the following page structure: Home Software Image Editor Full Article…
Get the root page ID
Get the ID of the root (oldest ancestor, parent without parents) page relative to the current page in a WordPress page template. Can be helpful for use with wp_list_pages() to create navigation markup.
Various code for Parent & Grandparent pages in WordPress
Show parent page title regardless of what subpage you are on: Find Page’s Top Level Parent ID This code can be used for displaying 2nd and 3rd level navigation links based on the current section. Code taken from the CSS Globe here: http://cssglobe.com/post/5812/wordpress-find-pages-top-level-parent-id Display a link to the top-level page of a section Find all Full Article…
Navigation Menu for sections based on parent and grandparent
This is pretty awesome! I needed to have a sub-navigation links menu using the wp_list_pages function for sections and child pages. I needed the menu to display appropriately if it’s a second-level page with only a parent pageĀ and also if it is a third-level page making the top-level page of the section a grandparent Full Article…