My problem seems relatively simple, yet I can't seem to find a simple solution for it.
I have a series of pages organized in 4 Levels, like so:
- Level 2
- - Level 3
- - - Level 4
What I would like to do, is add a sort of breadcrumb right before each page title which would display all parent pages (as links) of that current page in ascending order, but only up to Level 2 included.
Here are some examples:
@ If I'm on a Level 4 page, it would read:
Level 2 Page title | Level 3 Page title | Level 4 page title
@ If I'm on a Level 3 page, it would read:
Level 2 Page title | Level 3 Page title
@ If I'm on a Level 2 page, it would read:
Level 2 Page title
I tried using
wp_list_pages but I couldn't get it to work because it does not have a
parent parameter. I also tried using
get_pages('parent=0&hierarchical=0'), but I couldn't get WP to display the pages obtained.
Any help on this will be greatly appreciated!