Support » Fixing WordPress » highlighting selected page in wordpress

  • CreativeWP

    (@mevaser)


    I must place a highlight when a page is selected in this menu. I just can’t figure out how! I have tried several things. Below is the code for my nav, the second code is the one I was trying to incorporate in to the nav to make the highlight work. BUT it didn’t. Any help?

    <ul>
        <?php wp_list_pages( array('title_li'=>'','include'=>get_post_top_ancestor_id()) ); ?>
        <?php wp_list_pages( array('title_li'=>'','depth'=>2,'child_of'=>get_post_top_ancestor_id()) ); ?>
    </ul>

    <?php if ( is_page() { echo ' class="current_page_item"'; } ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘highlighting selected page in wordpress’ is closed to new replies.