Solved

Where is navigation set in WordPress

Posted on 2011-10-01
7
222 Views
Last Modified: 2012-06-27
Hello Experts - I am new to Wordpress, and know less about php, and am unclear about how to set the main navigation - I added a page which has a parent of one of the top level pages, but now its title is showing up in the main navigation. I'm not seeing where to remove this - can you help?

Thanks  
Steve
0
Comment
Question by:tablaFreak
  • 4
  • 3
7 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 36897136
It is theme dependent.  A good WordPress theme has an area for navigation defined in the header.php file.  This area checks to see if you have a custom menu defined (Appearance | Menus) and if so, it uses that menu.  If no menu is defined, a really well-developed theme will use a function to output a list of pages so that there is some form of navigation present. There are also themes that come with their own menu builders but this is getting rarer as the custom menu feature in the core improves.

So my guess is that you have a pretty good theme where it is looking for a custom menu and not finding one, so it is defaulting to all pages. Define a custom menu and see if it overwrites.  
0
 

Author Comment

by:tablaFreak
ID: 36897196
Hi Jason - Thanks for that, I found this call in home.php:

<?php wp_list_pages('title_li=&exclude=38,103,82,104,121,145,148,151,127,206,271,448'); ?>

but I don't know where that function is defined, or how to set pages to appear or not appear in the main navigation. It looks like certain pages are excluded there, by ID (?) but I don't know where to find the ID of the page I want excluded from the top nav.

Thanks for your help.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 36897292
wp_list_pages is a core function: http://codex.wordpress.org/Function_Reference/wp_list_pages

To find a Page ID, just go to the All Pages screen and hover over or click the Edit link for the page in question.  The ID is visible in the URL.  Once you have that, you add the ID to the exclude array above.
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:tablaFreak
ID: 36897367
That did the trick - thanks - but that worked fine as a hack, doesn't WordPress have a better way for a user to manage what's in the navigation? I'll accept your answer as the solution, but do you have any idea how the less saavy are expected to go about that?
Thanks, Jason.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 36897390
It's not a hack :)  If the theme uses wp_list_pages(), this is how you have to go about it.

>> any idea how the less saavy are expected to go about that

See my first post.  It really is dependent on the theme you are using.  A well-developed theme should have support for custom menus via the wp_nav_menu() function (http://codex.wordpress.org/Function_Reference/wp_nav_menu).

So apparently my assumption was wrong and whomever developed this theme just took a shortcut (or developed it a long time ago, before custom menus were supported).  The "better" answer would be to add the code for the custom menus and use wp_list_pages() as a fallback (via the fallback_cb parameter) if no custom menu is defined.  Alternately, wp_page_menu() is the function that would automatically be used if no custom menu or custom fallback param is found by wp_nav_menu().
0
 

Author Comment

by:tablaFreak
ID: 36897460
Gotchya - thanks much for the clarification!
0
 

Author Closing Comment

by:tablaFreak
ID: 36897462
thanks for your speedy help!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
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…

773 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