Solved

Wordpress 3.0 navigation issues

Posted on 2010-11-24
5
509 Views
Last Modified: 2012-05-10
I have a wordpress site that has two templates. One template is the home page and the other is for every other page accept the home page. I added a multi teired navigation menu through menus and the navigation works fine on the second template pages. But, when I try to add that same navigation code to my home page it doesn't show the sub menus. FYI, I have my home page set to static. Can I not use the same code and css for the home page navigation as the secondary navigation and how can I get this to work? Here is the link to the home page I am referring to.  My code in both files are <div id="access">wp_nav_menu('theme_location'  => 'primary', 'menu'            => primary_nav,  'container'       => '',  'container_class' => , 'container_id'    => ,'' 'menu_class'      => '', 'menu_id'         => 'access','depth'           => 0,);

http://sandbox.primomotif.com/obr/

thanks for the help!
0
Comment
Question by:bschave2
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 34206205
<div id="access">wp_nav_menu('theme_location'  => 'primary', 'menu'            => primary_nav,  'container'       => '',  'container_class' => , 'container_id'    => ,'' 'menu_class'      => '', 'menu_id'         => 'access','depth'           => 0,);

as far as I can tell the above can't work, you are mixing html with php, and you have a comma at the end of the wp_nav_menu call that doesn't need to be there.

when you say you have 2 different templates and that the home page is static, do you mean you have home.php and page.php or that your homepage is a page saved in wordpress but has a different template selected and is set as the home page?

In either case though make sure you are calling the same header file and that the header file somewhere before </head> has <?php wp_head();?>
0
 

Author Comment

by:bschave2
ID: 34206555
correct. The homepage is set to a page named something other than home or page.php. I am not calling a header file on the static homepage. Does that matter?
0
 
LVL 17

Accepted Solution

by:
jrm213jrm213 earned 500 total points
ID: 34206597
it doesn't technically matter, but I have seen all sorts of strange things happen when wp_head(); is not called as part of a pages header and the wordpress header.php has that in it as part of the page. You might try just putting a call to wp_head(); right before </head> in your home template.  
0
 

Author Comment

by:bschave2
ID: 34206691
Ok, I will try that and let you know if it fixes it.
0
 

Author Comment

by:bschave2
ID: 34270365
the issue was that the doc type was not put in the code and that was causing the nav not to work.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

823 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