WordPress.org

Ready to get started?Download WordPress

Forums

Removing Page Children from Tabs (4 posts)

  1. graemeuk
    Member
    Posted 5 years ago #

    I have just set up a new wordpress based site at http://www.geogteacher.com .

    I have started creating pages. But I am having two problems.

    1. I only want page parents to appear in the tabs on the page header

    At the moment every page I create appears in the tabs at the top of the page. Is there anyway that I can edit something or use a plugin so that it is only page parents that appear in the tabs. The example in my page is the 'extended essay' tab. This is a child page so i don't want it to appear in the header.

    2. The home page appears twice in the tabs at the top

    I have set up the page so that posts appear on a different page than the main page. However I have called my main page home and therefore home appears on the home tabs twice. Even if I called the home page something else it would appear on the tabs twice (for example once as home and once as index or whatever I call it).

    Thanks for any help anyone can give me. I appreciate it. I did have a look and could not find this question anywhere else.

    Thanks,

    Graeme

  2. graemeuk
    Member
    Posted 5 years ago #

    Below is the header code. I would be grateful if anyone could tell me what I needed to edit to only show the top level pages and not the sub pages in it.

    Thanks Graeme

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <title><?php if (is_home () ) { bloginfo(�name�); }
    elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo(�name�); }
    elseif (is_single() ) { single_post_title();}
    elseif (is_page() ) { single_post_title();}
    else { wp_title(��,true); } ?></title>
    <meta name="robots" content="index,follow" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_head(); ?>
    </head>
    
    <body>
    <div id="wrapper">
    
    <div id="header">
    <div class="topright"><!-- Edit welcome message here -->Welcome to Vistalicious! Here you can put a small description about your website or a link. <a href="<?php echo get_option('home'); ?>">Learn more about us &raquo;</a>
    
    </div>
    <h1 class="sitename"><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1>
    <h2 class="sitedesc"><?php bloginfo('description'); ?></h2>
    </div> <!-- Closes Header -->
    
    <div id="nav">
    
    <div class="search"><?php include (TEMPLATEPATH . '/searchform.php'); ?></div> <!-- Closes Search -->
    
    <?php function get_the_pa_ges() {
      global $wpdb;
      if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
         $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
    
       }
      return $these_pages;
     }
    
     function list_all_pages(){
    
    $all_pages = get_the_pa_ges ();
    foreach ($all_pages as $thats_all){
    $the_page_id = $thats_all->ID;
    
    if (is_page($the_page_id)) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    $output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
    }
    
    return $output;
     }
    ?>
    <ul>
    <?php
    
    if (is_home()) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
    echo list_all_pages();?>
    </ul>
    
    <div class="cleared"></div>
    </div> <!-- Closes Nav -->
    
    <div class="topcurvewhite"></div>
    <div id="main">
  3. citybumpkin
    Member
    Posted 5 years ago #

    I have the exact same two questions. Looking forward to any enlightenment y'all can offer!

  4. citybumpkin
    Member
    Posted 5 years ago #

    Checking back in to say this plugin has helped completely with the first issue of removing page children from the main navigation: http://gmurphey.com/2006/10/05/wordpress-plugin-page-link-manager/

Topic Closed

This topic has been closed to new replies.

About this Topic