Forums

menu (2 posts)

  1. Anonymous
    Unregistered
    Posted 1 year ago #

    hello guys im creating my theme and bulding the main menu using the wp_list_pages function. I have portfolio, about and screencasts as my pages so it all appears.. but how do i add a home menu so the output is

    home | screencasts | portfolio | about

    and also, this menu uses the sliding doors technique so i also need a way to highlight the current page.

    please help.

    tnx!

  2. sewmyheadon
    Member
    Posted 1 year ago #

    Might do something like this:

    <div id="navigation">
      <ul>
        <li <?php if(is_home()){echo 'class="current_page_item"';}?>><a href="<?php echo get_permalink(1); ?>">home</a></li>
        <li <?php if(is_page('screencasts')){echo
    'class="current_page_item"';}?>><a href="<?php echo get_permalink(2); ?>">screencasts</a></li>
        <li <?php if(is_page('porfolio')){echo
    'class="current_page_item"';}?>><a href="<?php echo get_permalink(3); ?>">portfolio</a></li>
     . . .
    </ul>
    </div>

    Where the number in the get_permalink bracket represents the ID of the page you're linking to.

    The . . . represent any other nav items you add.

    Make sense?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.