WordPress.org

Support

Support » Themes and Templates » Page IDs and Navigational matrix

Page IDs and Navigational matrix

  • tcherokee
    Member

    @tcherokee

    I wanted to find out if there is a way of assigning body id based on the page that you are on. For example, if you navigate to the about page, the body id will become <body id=about-page>.

    The reason I want to do this is because I’m using a css navigational system that relies on the body id to display the a hover and active states.

    Thanks in advance for your assistance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Jeremy Clark
    Member

    @jeremyclark13

    Why not just use this.

    <ul>
    <?php
    $pg_li="page_item";
    if (is_home()) {$pg_li .=" current_page_item";}
    ?>
    <?php wp_list_pages('title_li='); ?>
    </ul>

    Then whenever the link in the menu is the current page then the class current_page_item is applied to that link then you can style that class any way you want. Just a thought.

    tcherokee
    Member

    @tcherokee

    Thanks, gotten it to work 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page IDs and Navigational matrix’ is closed to new replies.