WordPress.org

Support

Support » Themes and Templates » Removing Menu Items

Removing Menu Items

  • I’m not sure if this is the right section. I think and hope that it is 😀 sorry if it isn’t though.

    Anyway, I have a few pages within my blog that I do not want displayed in the top header bar of the site. Now I’ve looked at a few solutions to this problem but I don’t really know what I’m doing so I’d just like to ask for a few ideas from you.

    This is my navigation part within my header.php file in my theme.

    <!– navigation …………………………… –>
    <div id=”navigation”>

      <li<?php if (is_home()) echo ” class=\”selected\””; ?>>“>Home

      <?php
      $pages = get_pages();
      if ($pages) {
      foreach ($pages as $page) {
      $page_id = $page->ID;
      $page_title = $page->post_title;
      $page_name = $page->post_name;
      if ($page_name == “archives”) {
      (is_page($page_id) || is_archive() || is_search() || is_single())?$selected = ‘ class=”selected”‘:$selected=”;
      echo “<li”.$selected.”>Archives\n”;
      }
      elseif($page_name == “home”) {“”;
      }
      elseif($page_name == “about”) {
      (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
      echo “<li”.$selected.”>About\n”;
      }
      elseif ($page_name == “about_short”) {/*ignore*/}
      else {
      (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
      echo “<li”.$selected.”>$page_title\n”;
      }
      }
      }
      ?>

    </div>
    <!– /navigation –>

    Any help would be much appreciated

Viewing 1 replies (of 1 total)
  • Just to clarify, all of the pages that I don’t want displayed are child items so maybe there is some kind of nagivation bar plugin out there that can create a drop down from the parent which then displays the child items?

    I just don’t need all these links in the title bar 😀

    my site is: http://www.scottnewham.co.uk

Viewing 1 replies (of 1 total)
  • The topic ‘Removing Menu Items’ is closed to new replies.