Style sidebar menu list different for child and parent pages
-
Hi, I found a lot of answers on this forum, so I thank you all for your hard work and help.
My question today is, I am styling a menu for a friend and can’t figure out how to style the child pages different from the parent pages in his sidebar menu.
Here is the sidebar menu code:
<?php $output = wp_list_pages('echo=0&depth=1&title_li=' ); if (is_page( )) { $page = get_query_var('page_id'); if ($post->post_parent) { $page = $post->post_parent; } $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' ); if ($children) { $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li='); } } echo $output; ?>
Right now, it is all governed by a single
div
, but since the list is automatically generated, I don’t know how to style the children different.Thank you all in advance, look forward to getting this fixed.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Style sidebar menu list different for child and parent pages’ is closed to new replies.