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)

1
vote
2answers
123 views

Anchor only wp_nav_menu

I am trying to create a list less wp_nav_menu. Below is the desired output: <nav class="nav header-nav"> <a href="#" class="nav-link nav-active">Home</a> <a href="#" ...
1
vote
1answer
35 views

Check what “type” a menu item is

The question I would like to check what type of menu item each item in my menu is i.e. is it a Page, Category, or Custom link. What I want to achieve I want to create a menu made up of categories ...
0
votes
0answers
25 views

Top level menu items different container than sub menu items

Is there a way to split the menu into two containers. The top level items would be in a separate container than the sub menu items. Here is the default structure <ul> <li> <a ...
0
votes
1answer
26 views

Showing the same menu in multiple location

Today I have faced an weird problem regarding WordPress menus. Here is the register function of my menus - function register_adaptive_menus() { register_nav_menus(array( 'top-menu' => __( 'Top ...
0
votes
1answer
597 views

How do I check if a menu exists?

I'm currently retrieving a nav menu based on the parent page's title, and if the page doesn't have a parent then it's own title. global $post; $page_title; if ($post->post_parent) { ...
0
votes
2answers
68 views

Hide a Menu Item on Login

I am using the following code to hide a menu item when a customer is not logged and show it when a customer is logged in. .hide-item-not-login{ display: none !important; } .logged-in ...
3
votes
1answer
3k views

Whats the difference between current_page_item and current-menu-item

Whats the difference between current_page_item and current-menu-item when using Custom Menus .current_page_item{} // Class for Current Page .current-cat{} // Class for Current Category ...
0
votes
0answers
43 views

There is a code that I don't understand - menu customize with walker

Here is a code I got from internet: (of couse I do not own it) class description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global ...
0
votes
1answer
655 views

wp_nav_menu not highlighting the current category when viewing a single post

My WordPress site has a bunch of posts, all filed by a top-level category and a bunch of subcategories therein. I have the main site nav rendering the category pages, which, when clicked, get all ...
0
votes
1answer
22 views

Sub Menu content is being duplicated

In the plugin I am developing I am using the following code to build my menu - add_menu_page('BCRM Plugin Settings', 'BCRM', 'administrator', __FILE__, 'bcrm_settings_page', BOOGIE__PLUGIN_URL . ...
0
votes
1answer
29 views

Displaying menu based on login status

I'm trying to show one menu based on whether or not the user is logged in. It's straight forward enough but when I change to my code I have no styles or icons like the original - see code below ...
1
vote
0answers
16 views

using plugin to add menu item to external page [closed]

I have a wordpress plugin that is working well so far. The last step for me is to have it create a menu item on the main navigation menu to an external page when you activate the plugin. Not sure how ...
0
votes
0answers
20 views

Adding Class and div id to wp_list_categories

I am trying to create a dropdown menu for wp header with categories and children as dropdown but cant find a solution, trying to get somethink like this <li class="Main-Cat"> <a href="Link ...
0
votes
0answers
14 views

Auto-build First Instance of Menu from Page Structure

I am wondering if there is a way to build a custom menu that is initially populated by the current page structure. I am working on a site that was initially build pre-custom menus, but now we want to ...
0
votes
1answer
140 views

Extend walker - navigation, adding data attribute to a tag

I would a data attribute to the a tag in the menu, like have <a href="#example" data-attribute="attribute">CLICK</a> I know that I have to extend the Walker BUT I tried in several times ...
1
vote
1answer
32 views

How to change menu URLs to hashes?

I'm building a fullpage Wordpress site. Meaning the pages are not separate URLs, they are accessed through the same URL. Something like deuxhuithuit.com. So I have a menu that the admin creates by ...
2
votes
1answer
322 views

How to assign a WP 3.0 custom nav menu to a theme's navigation menu location via script?

I'm using this script inside a plugin to create a new custom menu on the fly and assign a page to it... $menu_id = wp_create_nav_menu( 'header-menu' ); $menu = array( 'menu-item-type' => 'custom', ...
0
votes
1answer
30 views

Next page link via the custom menu

I would like to display a "next link" at the bottom of several page templates, using the actual custom menu in which they sit in. I built a function that mostly works except for an edge case ...
0
votes
3answers
74 views

Wordpress Login/Logout Single Menu Only

I've written this login/logout for my functions.php in my wordpress theme. The problem is, it's showing a login/logout link in all menus both primary and secondary. Is there a way to get it to ...
10
votes
2answers
2k views

How to add sub-menu to a menu generated by wp_nav_menu by using plugin

I have a menu generated by wp_nav_menu which look like <ul class="nav-menu" id="menu-top-nav"> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-43" ...
0
votes
0answers
21 views

Display the nav menu for a particular page id

Say that I have the id of a page that is in the wp_nav_menu() I would like to show the wp_nav_menu() for that particular page. Is that possible? I can use wp_get_nav_menu_items() to get all items for ...
0
votes
0answers
18 views

How to leverage hefty memory actions from programmatically creating nav menus

I'm working on a plugin right now and hitting a wall. Long story short, part of the plugin process is to construct a dynamic nav menu. This nav menu can get rather large, and I'm finding that it seems ...
1
vote
1answer
146 views

How use %like% in sql statement wordpress

i use a like %text% statement in wordpress: SELECT * FROM location WHERE name LIKE "%on" OR name LIKE "%on%" i tried anything but it's not run: $wpdb->get_results($wpdb -> prepare("SELECT ...
0
votes
1answer
64 views

Is there any way to recover deleted menu from database sql backup

i accidently deleted my main menu but i have a .sql database backup file and i want to recover my menu from this file. Is it possible? Thanks.
0
votes
2answers
1k views

Custom Nav Walker menu - Display children count

I have a custom walker menu.( See the code below) I would like to have my nav menu like this ---------------------------------- Home | link1 | link2 | link3 (5) ---------------------------------- ...
0
votes
1answer
36 views

Add menu headings to Wordpress sub menus

I'm using the native Wordpress menu. I have two top-level links with sub menus - I'd like for those sub menus to display the name of the parent menu item. So if I have a parent menu item named ...
1
vote
1answer
1k views

Add id to menu items in wp_nav_menu

I'm using wp_nav_menu in Wordpress to create my navigation The output is similar to this(I have removed href links) <nav id="pageNav"> <ul id="menu-headernav" class="menu"> ...
0
votes
1answer
99 views

Menu is not visible in appearance

I have added following code to my function.php function register_my_menu() { register_nav_menu('header-menu',__( 'Menu' )); } add_action( 'init', 'register_my_menu' ); And here is my code where ...
0
votes
0answers
18 views

current_page_item not being added in menu output

I've created a menu that I call on using following code. <?php wp_nav_menu( array( 'menu' => 'Primary Nav', 'container' => '', 'items_wrap' => ...
0
votes
2answers
3k views

Adding class atribute to wp_nav_menu ul

Update: this was caused by the fact that i didn't have a menu created in the menu page. I want to add a class to the ul of wp_nav_menu. I tried this code: <?php $defaults = array( ...
0
votes
1answer
83 views

Remove all nav menu classes except those which begin with certain letters

I'm currently using a function which strips out all the unwanted classes from my nav menus, leaving only the classes I want to keep (the ones listed in the array inside the function). It looks like ...
59
votes
11answers
25k views

Display a portion/ branch of the menu tree using wp_nav_menu()

I have a menu defined in WP Admin that looks like this: I want to be able to display all the child links on the sidebar whenever I am at a parent page. For example, if the user is on my "About Us" ...
0
votes
1answer
29 views

wp_nav_menu not displaying the right way

I'm creating a theme using bootstrap and now I want to display the menu adapting it to bootstrap... so I'm using the Upbootwp_Walker_Nav_Menu to achieve this, and also sending some args to the ...
0
votes
1answer
33 views

Mobile Menu Not Working

The mobile menu stopped working after I updated WP to the latest version, I assume it has to do with a customization of the theme. http://kvintage.com/ Wondering if anyone could please take a quick ...
2
votes
1answer
2k views

Creating WordPress Plugin solely for Admin panel with dash menu and submenus

I am attempting to create a WordPress plugin which allows the client to use for help and other resources in a friendly interface. It would be desired if I could have guidance on creating a WordPress ...
0
votes
0answers
21 views

Fixed top-level menu

I'm developing a site which has around 10 top-level pages in the menu and each have 4-5 child pages in the sub-menus. I am giving the site users the "Editor" role which I have customised using a ...
0
votes
1answer
60 views

Wrap description and sub menu in a wrapper

I am trying to add a wrapper to description and sub-menu in wordpress using walker class, Description will only be shown for the first menu so the structure will look like this EDIT I have been ...
1
vote
1answer
2k views

Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page

I am working with custom post types and I had trouble with the nav menu not getting the .current-menu-item on my custom post archive page menu item. In fact, when I was on that page or any of the ...
-1
votes
1answer
32 views

Customizing Responsive Themes Menu [closed]

I use the popular theme: https://wordpress.org/themes/responsive I would like to change the color of one of the menu items and if possible also have a jquery popup from one of the menu items. How can ...
0
votes
1answer
145 views

How to add custom field option with menu?

Please take a look at below image. Here we can see URL, Navigation Label & Title Attribute under Menu Structure >> Home. I need there a more option called "Data Description". I have a task to ...
2
votes
1answer
406 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. ...
4
votes
1answer
410 views

Show only 2nd level of navigation depending on active navigation

For example, suppose a menu like so: Parent 1 Child A Child B Parent 1 Child C Child D Child E Parent 2 Child F In a certain part of my template, I want something to show depending on ...
0
votes
0answers
42 views

wp_nav_menu use #<slug> instead of permalinks

I need help modifying the wp_nav_menu arguments so that it can generate a menu which has # instead of permalinks.. I know I can add custom link menu items, but I want the menu to be more dynamic .. ...
2
votes
3answers
1k views

Add Javascript to Wordpress Menu

Is there a way to put javascript in the URL portion of a Wordpress menu item? I have a live chat function on my site, and I am supposed to put this code onto the site to make a link to open the live ...
0
votes
1answer
22 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 ...
1
vote
2answers
350 views

Highlight current category, when using get_categories

I'm successfully using helgatheviking's answer from this post: Show children of top level category only See code below: // get the category object for the current category $thisCat = get_category( ...
1
vote
1answer
33 views

Change hyphen/dash for vertical line in menu [closed]

I have the theme Blaskan installed. I have a child theme installed also, but I cannot seem to change the hyphens/dashes to vertical lines | in my menu for this theme. Any suggestion would be ...
0
votes
2answers
27 views

How can I make this custom design menu work in wordpress?

I can make wordpress custom menu,but I got a problem with this type of menu. Can anybody give me any suggestion how to make this menu dynamic? screenshot: http://awesomescreenshot.com/0ab3d6an94 ...
0
votes
2answers
131 views

How can I get an array/list of all current WordPress Admin Menu items?

I would like to somehow retrieve a list of all current admin menu items, even the ones created by themes/plugins. Is it possible?
1
vote
1answer
537 views

How to add fixed position in menu class for Twenty Twelve theme?

I have already looked at many jquery examples on how to make the menu sticky. I have applied these tutorials on clean html pages and they have worked perfectly. However, when I try to apply it on the ...