Displaying Title of Parent and Child Page
-
I am trying to do something that seems fairly simple but I can’t find a solution.
I am using wordpress as a CMS. I want the top of each page that wordpress generates to display the name of parent page on one line and then the name of the child page on a new line using a different header(unless the page is its own parent)
<h1>Parent Page Name</h1>
<h2>Child Page Name</h2>the_title()function doesn’t work, because I need a way to first check to see if the current page is its own parent. If it is, it will display at the top as the <h1>, otherwise it should find the parent page name, display it on the first line and then put the current(child) page name on the second line.
Please help me
- The topic ‘Displaying Title of Parent and Child Page’ is closed to new replies.