Solved

wordpress 4 menu problem

Posted on 2014-09-17
6
280 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

What's this? As a volunteer Page Editor for Experts-Exchange.com, I have noticed that many authors also have blogs, and pull articles from their blogs to post at Experts-Exchange. I appreciate each author sharing their blog content with our site …
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 users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

730 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