Style current Page differently for wp_list_pages?
-
Hi, I am using the following code to create subnav for the current Page. My client would like the Page the user is currently on to be styled a different color. Does anyone know of a way to modify wp_list_pages so that it doesn’t link the current page or adds a class to the link?
<li><a href="/index.php?page_id=9">Who</a> <!--check for Who (ID = 9) subpages--> <?php if (is_page(9) || $post->post_parent=="9") { if($post->post_parent) $children = wp_list_pages("sort_column=post_date&title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("sort_column=post_date&title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } } ?> </li>
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Style current Page differently for wp_list_pages?’ is closed to new replies.