Show parent pages from a sub-page

The issue:

Site has a page system with three levels of pages. When a page has sub-pages, show the children in the menu, but at the bottom level, show the parent’s menu items still.

The fix:

If the page has children, display them.  If the page does not have children, display the parent pages children. If the page is a top level page, with no children, do not display anything.

The code:

 

This entry was posted in Coding, PHP, WordPress and tagged , , , , . Bookmark the permalink.

Comments are closed.