• I’m using the whiteboard theme and trying to hide subpages from showing in the navigation menu. I found some tutorials on the subject and I think this code can do do the trick

    <?php wp_list_pages(‘depth=1’); ?>

    but I don’t know where to place place it.. I tried pasting it randomly but nothing happens. I’m also trying to avoid plugins for this and keep it as simple as I can.

    Please help meh!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Find that code in your themes template files. It is probably in your themes header.php file or the themes sidebar.php file. All your themes files are stored in the themes folder in the wp-content/themes folder.

    Thread Starter virgild

    (@virgild)

    Thanks for responding!

    The problem is that I can’t find the code. I looked in all .php. I think I have to add it but I don’t know where exactly. I tried but nothing happens..

    have you a link to your site?

    Thread Starter virgild

    (@virgild)

    I’m too embarrassed to show it lol.. may I paste the header php?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="https://gmpg.org/xfn/11">
     <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
     <title><?php wp_title('|', true, 'right'); ?> <?php bloginfo('name'); ?> <?php if ( !wp_title('', true, 'left') ); { ?> | <?php bloginfo('description'); ?> <?php } ?></title>
     <meta name="generator" content="WordPress" /> <!-- leave this for stats (or remove for potential security reasons) -->
     <meta name="author" content="Brian Purkiss" />
     <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="container">
    
    <div id="headernav">
       <?php wp_page_menu(); ?>
      </div><!-- end #topNav -->
    
    <div id="banner">
    <?php
      $content = "[smooth=id: 1; width:825; height:284; timed:true; arrows:false; carousel:false; links:false; info:false; align:center; frames:false; delay:2000; transition:fade;]";
      smooth_show($content);
    ?>
    </div>
    
     <div id="header">
      <div class="title">
       <h3><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('description'); ?>"><?php bloginfo('name'); ?></a></h3>
       <h4><p><?php bloginfo('description'); ?></p></h4>
      </div>
    
    <div class="searchbar">
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </div>
    
     </div><!-- end #header -->
    Thread Starter virgild

    (@virgild)

    I tried pasting it under <div id=”headernav”>

    but a duplicate navigation appears above the original

    You would need to replace this:
    <?php wp_page_menu(); ?>

    Thread Starter virgild

    (@virgild)

    Thanks that worked!

    do you know how remove the text “pages” in the beginning of the page links? I don’t know why it shows up.

    Use this:

    <?php wp_list_pages('depth=1&title_li='); ?>

    Reading this page will help:

    https://codex.www.ads-software.com/Template_Tags/wp_list_pages

    Thread Starter virgild

    (@virgild)

    thanks! that work. I’ll study the codex.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘how to hide sub-pages from showing’ is closed to new replies.