Solved

wordpress 4 menu problem

Posted on 2014-09-17
6
274 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
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 insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
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…

911 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

19 Experts available now in Live!

Get 1:1 Help Now