I’m using the a call to
wp_list_pages()in my sidebar and would like to setup some JS/CSS to hide all the sub-pages of other parent-pages. My page structure is:
# Visitors’ Guide (
* Events Calendar
* Island News
* Island History & Culture
* Find Local Businesses
* Directions & Travel Info
# Getting Here
* Island Map
* Site Map
* For Advertisers
For some reason, on some pages that are children of Visitors’ Guide,
.current_page_parentis assigned to the wrong li.
– when Island News or Events Calendar are the current page, Island news is assigned
– when Directions & Travel Info is the current page, Visitors’ Guide is assigned
.current_page_parent(as it should be)
The wierdest thing is that Events Calendar & Island News have a div
#contentwith the class
.parent-pageid-7(as it should be), so it’s not messed up everywhere.
Where do you think this is getting screwed up? (Deleting the Island News page and re-creating it did not help.)
Is nobody responding because I put this question in the wrong section or because you’re not sure what’s going on?
If I’m getting this correctly, you want to display the sub pages (children) only if you are on that parent page.
with the wp_list_pages you should be able to exclude the sub pages by setting the depth to 1. But to set it up by parent, I think you will need an if statement and will have to do it in your sidebar template.
maybe someone else will have a better solution.
@cdembinski thanks for the reply.
.current_page_parentclass is being applied incorrectly. I’m not sure how to troubleshoot this because it seems like a database error.
- The topic ‘current_page_parent is wrong?!’ is closed to new replies.