Navigation Menu is a theme feature introduced with Version 3.0. WordPress includes an easy to use mechanism for introducing customised navigation menus into a theme. In order to incorporate menu support into your theme, you need to add a few code segments to your theme files.

learn more… | top users | synonyms (4)

2
votes
1answer
171 views

How do I approach removing menu items on the fly based on settings in my plugin?

I've started writing a plugin that allows the administrator to select specific pages and set them to be visible only to logged-in users; the plugin optionally applies the restriction to all child ...
2
votes
1answer
4k views

Using wp_get_nav_menu_items() to list children of children pages

I'm working with a Genesis Based Theme and I'd like build a Page/ Child Page menu structure. That part I can do with the help of some code produced by Bill Erickson. Essentially what I'm trying to do ...
2
votes
1answer
5k views

How show sub menu only using wp_nav_menu()

I am using this code to show the custom menu subpages if you are on the parent page. But what this code also shows is a parent page on a page that has no sub menu, which I would like hidden. Basically ...
1
vote
1answer
57 views

How to remove admin main menu name repetition

I have added an admin menu using add_menu_page. When there is a sub menu with add_submenu_page, The main menu name is repeating. How to remove this repeating menu ? This is my code ...
1
vote
1answer
166 views

Unable to center menu and header image twenty twelve

I have a really simple site at cyriljoyce.com on the 2012 theme I created a child theme to center the header and menu bar but just cannot seem to make it work. The child theme text is below The line ...
1
vote
1answer
54 views

Create a Page via plugin

My problem is to show a list of products read from db tables. I know how to read them and I am able to produce the table, but only using a shortcode embedded in a page that I've created via WP. I ...
1
vote
1answer
125 views

Using Walker To Add Menu CSS Class Functionality

I'm trying to add the ability to insert Custom CSS Classes to menu items. I believe I do this by extending the walker_nav_menu but I'm not sure how to call the custom classes. This seems like such a ...
1
vote
1answer
42 views

Adding an admin menu page showing the link twice - how to solve this?

I'm newbie and I'm trying to create a plugin to add a menu to left menu in admin section. i have create the page but it is working fine. but i find the left menu being displayed twice. how can I ...
1
vote
1answer
21 views

Recommended method for updating/adding menus when adding new theme

I'm working locally on a completely new theme. Once I'm done I'm going to use the "test drive" plugin to allow admins to test the theme before switching over to it. The problem is that with the new ...
1
vote
1answer
76 views

Add custom menu item type

Is there a way to add custom menu type to the menu editor? I know I can add items dynamically with the wp_get_nav_menu_items filter, but I would like to have the position of those items configurable. ...
1
vote
1answer
150 views

HTML list menu to Wordpress menu

I have purchased an HTML theme that I want to rebuild into Wordpress. I'm having trouble making the menu work. Beneath is the HTML for the menu. (without the beginning and end of the UL). <li ...
1
vote
1answer
290 views

Displaying different page links on different pages

I have a wordpress site with 100+ pages. Now suppose 5 pages are related to page 1, and I want to show them in side bar as similar pages/related pages and other group of pages in other menu in ...
1
vote
1answer
141 views

Set Item Order with wp_nav_menu_{$menu->slug}_items

I have some code that adds a menu item to a menu using wp_nav_menu_{$menu->slug}_items. It's pretty easy to add a menu item as the first or last item of the menu, but I was wondering if there's ...
1
vote
1answer
161 views

list category posts under its item in menu

When adding category to Menu, I need it to list all the item that belong to that category in separate UL automatically. like this http://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, ...
1
vote
1answer
1k views

Wordpress 3.5 dropdown menu

I'm pretty new with wordpress and I want to create my own dropdown menu without the use of any plugins. I have a few questions about this. I already did some research but there are some things i do ...
1
vote
1answer
233 views

display only the wp_nav_menu, which has the current-menu-item

i have a problem displaying only the menu with wp_nav_menu, in which the current-menu-item is in. Heres what i got: function register_menus() { register_nav_menus( array( 'sidebar-menu' ...
1
vote
1answer
113 views

Main menu highlighting on subpage which is not in submenu but in hierarchy

I have my menu made of images. Therefore I use divs and with .current-menu-item I use CSS to change the image. This works if I'm directly on this main page. If I'm on a subpage I cannot use this trick ...
1
vote
1answer
104 views

pull non-wp site into content area of wordpress -or- pull wp header into non wp site?

I am building a site which has a ecommerce nature that is not able to be tied directly into wordpress. What my goal is to have a constant header that is generated by my wordpress header on all pages ...
1
vote
1answer
146 views

Custom Post Type Nav to Subpage

I've registered a post type for an audio plugin, the post type is "Custom Players" in the admin and has its own tab on the admin sidebar. I'm just curious if there's a simple way to move this out of ...
1
vote
1answer
50 views

cross-site custom menu

i have a multisite whice i want to separate because its unneccery as two of my sites are on the same DATABASE and all i need is actually the dynamic custom menus which i have built in the main site(to ...
1
vote
1answer
101 views

Custom Post type menu highlighted in the archive/post

I created a custom nav menu for my custom post type by custom links (linked to the archive page). Let say I have a custom post type named "product", and when I click on the menu, it will go to the ...
1
vote
1answer
339 views

Menu Custom link - using relative link when WP is in a subdirectory

I tend to develop sites in a subdirectory, and I tend to use a fair amount of custom links in my menu ( the "Custom Links" option in the WP admin Appearance > Menus section) to display archive pages. ...
1
vote
1answer
132 views

API for wp menu hacks

Question changed due to new developments! I was loooking for a way to hack the menu items in the custom menu page to add a "hide" checkbox and other options. The only way I found is to override the ...
1
vote
1answer
239 views

custom menu widget where menu title is a link

I am looking for, like the title of this question indicates, a custom menu in wordpress where the menu title itself is a link. It seems like a very simple thing, but after a lot of searching I've come ...
0
votes
1answer
10 views

Menu Structure with Links failure to update

Sorry if this sounds like a newbie question but this is driving me crazy and I can't seem to figure it out. I want to add a link called "About Me" to my Menu that redirects to another website. It ...
0
votes
1answer
20 views

How to programmatically add elements in a custom menu

In my WP custom menu, one item has a dropdown list below it that lists all instances of some CPT. The only way I know to do that is by creating the list somewhere else in the DOM with PHP and then ...
0
votes
1answer
4 views

menu_class showing up on DIV instead of UL

I was having an issue where my menu was being created using: wp_nav_menu(array('theme_location' => 'main_menu', 'menu_class' => 'sf-menu'')) The resulting HTML was like this: <div ...
0
votes
1answer
22 views

Add a Submenu from Another Submenu in a Custom Theme

Good day everyone! I would like some help from you since I'm just a beginner in WordPress. I would like to add a submenu under another submenu like this: International China Independent Group ...
0
votes
1answer
14 views

Editor access to menu: custom post type missing

I have used this code; $roleObject = get_role( 'editor' ); if (!$roleObject->has_cap( 'edit_theme_options' ) ) { $roleObject->add_cap( 'edit_theme_options' ); } to add menu access for ...
0
votes
1answer
33 views

How do you manage large menu hierarchies in WP?

Has anyone worked on sites where the menu hierarchies is fairly large? Not more than 3 levels deep, but more than 40+ menu items? If you only list first level items in the top menu without dropdowns ...
0
votes
1answer
13 views

add custom classes to anchore in wp_nav_menu

i wana add custom class to anchores in wp_nav_menu outputs. default for example is : <li id="menu-item" class="menu-item menu-item-type-custom"> <a ...
0
votes
1answer
24 views

Give a condition to a wordpress menu item to change its offerid for each landing page I create

So my wordpress site has a one header and one footer with a big CTA as one of the menu items. I want to create a bunch of landing pages but I want to be able to change the offerid in the url for each ...
0
votes
1answer
13 views

Showing a link with Javascript based on log-in status

<?php if ( is_user_logged_in() ) { echo ''; } else { echo '<a onclick="ppOpen('#login_panel', '800',1)" href=\"javascript:\">Entrar</a>'; } ?> Hello, I'm trying to make this work ...
0
votes
1answer
36 views

Remove nav menu or menu item

I try to remove a nav menu programmatically but I didn't find the way to do it. I knwo how to create it but I don't know how to delete it... I've got the menu name and I wan't to delete it like in wp ...
0
votes
1answer
34 views

How to remove dropdown from wp_nav_menu

I dont want to have dropdown (select - options) in my wordpress menu, even in mobile or lower width devices. I know I can use css to hide it, but I want to remove it at all. I googled for an hour and ...
0
votes
1answer
46 views

WordPress filter to hook into menu <li> items and add a custom attribute

I have a WordPress template (I'm using Foundation as a base and https://github.com/olefredrik/foundationpress/ as a starter theme) I'm trying to build and I can't seem to figure out how to hook into ...
0
votes
1answer
24 views

Add <span> within the <a> output of <? wp_nav_menu() ?>

Currently i am using: <?php echo wp_nav_menu( array( 'menu' => 'main-menu','depth'=> 1,'items_wrap' => '<ul class="navigation_ul">%3$s</ul>' ) ); ?> I want to achieve: ...
0
votes
1answer
10 views

Highlighting Main Navigation Menu With Two or More Class Matches

I believe this doesn't happen very often. I am working on a project in which a child page can show up under several different parent pages. The page actually belongs to just one parent, but in the ...
0
votes
1answer
27 views

Display a tag before the menu list content

Is that possible to insert a text before the menu items? In this case, I want to lead a <h3> tag for the list content (like a menu title). I tried the if/else to recognize that the menu have ...
0
votes
1answer
11 views

List of WordPress menu item indices?

The following code will rename the "Posts" menu item to "Blog Posts" in the WordPress Dashboard: function lc_change_post_menu_label() { global $menu; $menu[5][0] = 'Blog Posts'; } add_action( ...
0
votes
1answer
35 views

How to get menu location in wp_update_nav_menu hook

I want to get the menu location in the wp_update_nav_menu (during menu save action) add_action('wp_update_nav_menu', function ($id, $data = NULL) { error_log( var_export($data, true) ); ...
0
votes
1answer
28 views

How to make top level menu think it has a current item

This question has always tripped me up, but it seems like there should be an easy solution. I have created a couple pages in a hierarchy as follows. About Us - History - Mission Events ...
0
votes
1answer
38 views

Horizontal Navigation

Hi. I been fighting with this problem for couple of weeks now. Trying various approaches. From CSS styling to a custom walker. I want to render each level as its own element. The navigation ...
0
votes
1answer
18 views

add_media_page function not creating submenu

I have the following plugin that I'm just testing at the moment. /* Plugin Name: Menu Test Plugin URI: http://codex.wordpress.org/Adding_Administration_Menus Description: Menu Test Author: Codex ...
0
votes
1answer
27 views

Add link at the end of wp_nav_menu

I need to add a conditional menu item such as "/at" or "/de" or "/ch" in the wp_nav_menu. Since the link is conditional (based on the country the website is being viewed), it can't be added from the ...
0
votes
1answer
43 views

How to get current menu item “CSS Classes” value?

While on any given link that has a CSS Classes value, I'd like to do something like this: $css_classes = get_current_menu_item_css_classes(); if ( $css_classes == 'mycustomclass' ) : // do ...
0
votes
1answer
28 views

How can I pass value to function in add_menu_page?

I was use to pass value to function for the below menu. add_menu_page('Competition Manager 2013-2014', '2013-2014', 'manage_options', 'manager_2013_2014', 'manager_2013_2014', plugins_url( ...
0
votes
1answer
34 views

nav_menu: how to force a subpage switching on the parent menu

I've been using the native wp_nav_menu to output my navigational elements. I have also created a subpage that is nested under one of my menu, but when I hit that URL the default custom walker clearly ...
0
votes
1answer
62 views

wp_list_pages, links only for pages with no children

Is this possible to do, and what is a best practice solution? The things I can think of is parsing the page structure myself, or do it with JQuery to convert <a> to <span> or similar. Is ...
0
votes
1answer
80 views

current_page_item is missing inside wp_nav_menu

I'm using the function wp_nav_menu like this: <?php wp_nav_menu( array( 'container' => false, 'echo' => true, ...