Current Page Item
-
I have a sidebar that displays the parent page as ‘Overview’, and all subsequent child pages. I use the following code:
<?php if ($post->post_parent != 0) { $parent = $post->post_parent; } elseif(is_404()) { $parent = 23; } else { $parent = $post->ID; } $parent_title = get_the_title($parent); $parent_link = get_permalink($parent); ?> <h3> <?php echo ($parent_title); ?> </h3> <ul> <li> <?php echo ('<a href="'.$parent_link.'">' . Overview . '</a>'); ?> </li> <?php wp_list_pages('title_li=&child_of='.$parent); ?> </ul>
I’m trying to figure out how to modify the code so that I can take advantage of the ‘current_page_item’ class when the page is being looked at (to highlight the link). It works for other pages, but not for the ‘Overview’ or parent page.
An image of the sidebar can be seen here: https://dl.dropbox.com/u/4898592/sidebar.jpg
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Current Page Item’ is closed to new replies.