Support » Themes and Templates » Pages in Header Help

  • On my blog the header will continue to add each page that I create.

    The Code:

    <div class="primarynav">
    <li class="first">
    <a class="<? echo (is_home())?'current_page_item':'off'; ?>" href="<?php echo get_option('home'); ?>/">Home</a></li>
    <?php $pages = wp_list_pages('title_li=0'); ?>

    If you go to my blog: KnockedOutBlog you will see that it says advertise on the top. That’s a page that I don’t want in the header, how would I go about keeping the About Us and Home but removing advertisements.

Viewing 2 replies - 1 through 2 (of 2 total)
  • A really simple way is to use a plugin that allows you to select whether or not a page gets included in the navigation.



    Forum Moderator

    First go into Admin/Pages and find the Advertise page. Place your cursor over the page title in the list and look in your browser status bar. You’ll see a url that ends with something like post=123. That number is the id of the Advertise page. Armed with the page id, you can now exclude it from your menu by using:

    <?php $pages = wp_list_pages('title_li=&exclude=advertise_page_id'); ?>

    replacing ‘advertise_page_id’ with the appropriate number.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pages in Header Help’ is closed to new replies.