[Webinar] Learn how to a build a cloud-first strategyRegister Now


Navigation style on wordpress themes

Posted on 2010-01-03
Medium Priority
Last Modified: 2012-05-08
I have found a great wordpress theme that I like and sits well with my site - the only problem I have is that the main navigation across the top of the page (which shows the pages), also insists on showing the sub pages.

Can anyone tell me where I need to "hack" the code to stop it displaying sub pages in the main navigation, and instead show it in the sub nav where it is not displaying!

Question by:andrewh123
  • 2
  • 2

Expert Comment

ID: 26168614

try removing any nested <ul> inside <li> where the navigation is defined.

Open in new window


Author Comment

ID: 26168803
Hi - where would that be?
I can't find the file that holds that information.
LVL 12

Accepted Solution

Tony van Schaik earned 2000 total points
ID: 26174707
You probably need to edit the header.php of your theme and search for wp_list_pages and set the depth to 0 (to disable the subpages) more info on that here: http://codex.wordpress.org/Template_Tags/wp_list_pages

Good luck


Displays a list of WordPress Pages as links. It is often used to customize the Sidebar or Header, but may be used in other Templates as well.

 <?php wp_list_pages( $args ); ?> 
Default Usage

 <?php $args = array(
    'depth'        => 0,
    'show_date'    => ,
    'date_format'  => get_option('date_format'),
    'child_of'     => 0,
    'exclude'      => ,
    'include'      => ,
    'title_li'     => __('Pages'),
    'echo'         => 1,
    'authors'      => ,
    'sort_column'  => 'menu_order, post_title',
    'link_before'  => ,
    'link_after'   => ,
    'exclude_tree' =>  ); ?> 

By default, the usage shows:

    * All Pages and sub-pages are displayed (no depth restriction)
    * Date created is not displayed
    * Is not restricted to the child_of any Page
    * No pages are excluded
    * No pages are explicitly included
    * The title of the pages listed is "Pages"
    * Results are echoed (displayed)
    * Is not restricted to any specific author
    * Sorted by Page Order then Page Title.
    * Sorted in ascending order (not shown in defaults above)
    * Pages displayed in a hierarchical indented fashion (not shown in defaults above)
    * Includes all Pages (not shown in defaults above)
    * Not restricted to Pages with specific meta key/meta value (not shown in defaults above)
    * No Parent/Child trees excluded 

Open in new window


Author Comment

ID: 26174949
Perfect thank you!
LVL 12

Expert Comment

by:Tony van Schaik
ID: 26175201
You're welcome

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question