Solved

wordpress 4 menu problem

Posted on 2014-09-17
6
282 Views
Last Modified: 2014-09-17
hi
i am doing a theme from scratch.
in the function.php i register the menu like that

register_nav_menu( 'primary', __( 'Primary Menu', 'blankwptheme' ) );

Open in new window


then in the header.php i wrote that in the menu:
                        $defaults = array( 
                            'container' => 'nav',
                            'menu_class' => 'horizontal black', 
                            'theme_location' => 'blankwptheme',
                            );
                        
                         wp_nav_menu( $defaults );

Open in new window


once i specify the theme location, there is no van container, and a div with the class of horizontal black is created, not the ul.
if i remove the theme location, the appear correctly.

what am i doing wrong?
0
Comment
Question by:derrida
[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
  • 3
  • 3
6 Comments
 
LVL 15

Accepted Solution

by:
eemit earned 500 total points
ID: 40327623
Replace this:
'theme_location' => 'blankwptheme',

Open in new window

with:
'theme_location' => 'primary',

Open in new window

0
 
LVL 1

Author Comment

by:derrida
ID: 40327645
well, it fixed the html, but now when changing languages  it doesn't show the translated items. i'll see what can it be. but at least the html is correct.
so theme_location means the name of the menu i declared?
0
 
LVL 1

Author Comment

by:derrida
ID: 40327650
it seem like you have to create a menu for every language. thanks
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 15

Expert Comment

by:eemit
ID: 40327869
it seem like you have to create a menu for every language. thanks
No! You only need to translate this:
__( 'Primary Menu', 'blankwptheme' )
for every language.
0
 
LVL 1

Author Comment

by:derrida
ID: 40328253
hi just seen the last comment. what do you mean? i am using polylang plugin.
in the admin menus. i should not create a menu for each language?
i tried it, but then it listed all the pages from all languages?

how should i do it?
0
 
LVL 15

Expert Comment

by:eemit
ID: 40328687
I have no experience with Polylang.
But maybe you're right.
Have you tried with Manage Locations?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
This video teaches users how to migrate an existing Wordpress website to a new domain.

728 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