wp_list_pages unusual conditional statement help
-
I’ve read a lot of posts here in support for people wanting to use wp_list_pages to change navigation or styling for the list when you’re on a particular page.
My problem is different, I would like to create a conditional statement that I can use to style the background color differently for pages I designate. So (in plain English) if post = 25 then make the li element background for post 25 “grey”.
In the elements that wp_list_pages brings page you get first the ul, and then the individual li’s like this:
<li class=”page_item page-item-25″>
I want edit my stylesheet to make the background for “page-item-25-grey” which is easy enough, but what if I want to make all it’s children grey background too (and don’t want to edit the css everytime I add a child page)?
Is this a CSS hack, or a conditional php statement I can add to wp_list_pages?
- The topic ‘wp_list_pages unusual conditional statement help’ is closed to new replies.