Solved

wordpress 4 menu problem

Posted on 2014-09-17
6
278 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Suggested Solutions

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 …
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
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…

809 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