Solved

wordpress 4 menu problem

Posted on 2014-09-17
6
272 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
  • 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now