Solved

Where is navigation set in WordPress

Posted on 2011-10-01
7
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

739 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