Detect if current page is subpage
-
I’m attempting to use WordPress as a CMS, and want to make use of the subpages feature.
If the user is on a parent page, I want to put a list in the sidebar of all subpages.
If the user is on a sub page, I want to put a list in the sidebar of all the subpages of the parent page.
In order to do this I think I need to detect if the current page is a sub page, and then execute different code. So how do I detect which type of code it is.
Also, if I am on a sub page, how do I detect the name of its parent page?
Many thanks, and I hope that makes sense!
Huw
- The topic ‘Detect if current page is subpage’ is closed to new replies.