Tagged Questions

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)

0
votes
1answer
65 views

Pagination doesn't work on multiple categories

I have the following problem. In my custom menu (wp_nav_menu) I added a category. This category uses the template category.php. Now I have multiple categories that are shown on the page. My problem is ...
8
votes
1answer
1k views

Mega Menu Walker

I'm trying to create a mega menu walker. Unfortunately, walkers completely escape my coding knowledge. I could really use some help getting it working. Here's the features I need: Wrap the ...
0
votes
1answer
41 views

WP_NAV_MENU filter targets all menus

Im trying to replace my template's primary menu through a plugin so that I don't have to make changes to the header.php. I found this code in another question answered here in 2011 (Replacing ...
0
votes
2answers
81 views

add dynamic ID for wp_nav_menu after and before

I have menu like this: <ul> <li> <div class="buttons-4" title="some_title"> <a href="[some_url]">[something]</a> ...
0
votes
0answers
60 views

If menu has submenu, add parent as first child

I am using CSS framework (Metro UI, but this is a problem in Bootstrap too). When I set parent menu, the item itself isn't clickable, it's only toggle for its submenu. I tried to change JS and CSS so ...
0
votes
0answers
27 views

Disappearing items in menu

I have problem with disappearing items in menu. I added php_value max_input_vars 7000 php_value suhosin.post.max_vars 7000 php_value suhosin.request.max_vars 7000 to my .htaccess but it doesn't ...
0
votes
1answer
19 views

Hook on creating a menu entry?

I need to run some code after a new item has been inserted into a WordPress nav menu. Is there any hook on menu modification or something similar?
0
votes
1answer
227 views

Making a Custom Menu Sidebar Icon show as Current in css [closed]

In the custom WP Menu I have assigned classes which are different for each menu item. For example .power-icon a { padding-left: 35px !important; background-image: url(/images/icon-grey.png); ...
1
vote
0answers
27 views

Weird behaviour on Edit Menus screen

I am running WP 3.9.1. Fresh install. ACF and Gravity Forms are the only two plugins running. Perhaps someone had this issue before... On the edit menu screen I have a tab called "View All" where I ...
1
vote
1answer
288 views

Hide menu item in certain condition

I'm using the plugin qTranslate and I have to hide one menu item when the language isn't Italian. Searching online I created this solutionand applied the solution in this post I created the file ...
0
votes
1answer
64 views

I can't add more pages to menu - menu delete pages

Two days ago I decided to add three more pages to the menu on my site. I already had like 140 pages in the menu, so this is something I know how to do. But I hadn't done it in some months, so maybe ...
0
votes
2answers
91 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
301 views

how to put the logo in the center of other items in the navigation bar

I'm developing a website in wordpress and I have to create a navigation bar in which the logo of the website has to be put between items like this: item1 item2 LOGO item3 item4 I'm thinking to use ...
0
votes
1answer
58 views

Custom navigation menu with awsAccordion

I'm making a custom template for my client. Well i'm strangling for hours, for making the vertical accordion menu dynamic so my client can change the nav links etc. The structure of the navigation is ...
0
votes
1answer
82 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
59 views

Confused about the correct functioning on Wordpress Menus

good evening, Im been having some kind of problem with a specific, and as far as I can see, simple WP project, specifically with how to use the wp_nav_menu function, normally, when I try to create a ...
0
votes
0answers
53 views

How to programmatically add login form to wp_nav_menu X position

I have a menu I created in WP that registers 'main_nav' so the user can still use the Appearance > Menus screen to edit their menu. However I need to add the login form to the 4th (main) menu items ...
0
votes
1answer
60 views

Theme modification for custom category menus

My goal is to have a custom menu in the header based on the category of the post being viewed. I'm setting up a single wordpress site that will contain about a half dozen different categories. ...
1
vote
1answer
85 views

wp_nav_menu add some element to container

I've tried to hook wp_nav_menu_args to get an ID for the nav menu. I tried to add an element using javascript to container menu. But I never get the ID for the menu. How can I add an element to a nav ...
0
votes
0answers
78 views

Get the menu name or location of current menu item

I am having a hard time trying to get the name of the active menu and, apparently, I cannot find any solutions to this issue. Basically, I have several menus that follow this pattern: Menu Name ...
0
votes
0answers
24 views

How to display counter for post in navigation?

I have custom post type called Booking. It have custom post status : "waiting confirmation" and "confirmed". I want to display counter in navigation menu to count total post which status is "waiting ...
0
votes
1answer
56 views

Retrieve Menu name for nav_menu_item

Given a nav_menu_item object, how would I determine the name of the Menu it is associated with? I have a couple menus defined in my theme, as well as, a nav_menu_css_class filter. Inside the filter, ...
0
votes
1answer
41 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 ...
1
vote
3answers
341 views

multisite: global menu containing network site links?

Can I create one single menu that appears on every page within the network and contains every site and page that exists within the network? I'm talking about the following structure: Main Site ...
0
votes
1answer
46 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 ...
3
votes
2answers
120 views

Adding Post Counts to Menu (Nav) Programmatically?

I'm fairly stumped on this. Without getting too query-heavy, I was wondering what path one might take to produce a menu that links to a category of posts, and displays in parenthesis how many new ...
0
votes
0answers
31 views

How to hook new args into a Custom Menu Widget?

I am trying to add some code before the list items in a sidebar Custom Menu Widget. Maybe I'll add an image, maybe I'll add some text. Not sure yet. But I'm having a hard time trying to figure it ...
0
votes
0answers
26 views

Menu not saving in dashboard

I've created menus in wordpress dashboard countless times and never had a problem saving them until today. Getting this error: "The menu name Main Menu conflicts with another menu name. Please try ...
0
votes
1answer
96 views

Category menu that filters out empty categories

I'm trying to build a menu which can be administered from the menu editor, but gets filtered before being output. More specifically the menu contains Woocommerce product categories, organised into a ...
4
votes
1answer
82 views

How can I add (custom) modules to Appearance -> Menus?

Does anyone know how I can add (custom) modules to Appearance -> Menus? (Or has a link with explanation on how to do this) so that when people change their menu in the backend they can choose what to ...
1
vote
1answer
502 views

Change an li class name in a wordpress custom menu walker

I'm building a nav that has a class applied to the main LI's and the nested LI's. Example: <ul> <li class="className">Test</li> <li class="className">Test <ul> ...
0
votes
0answers
55 views

how to keep currently selected menu item while selecting another menu item in second menu

In wordpress 3.9.1 I'm trying to create my own theme. One of the things my theme should be able to deliver is to have two menu's. I do have that. It is working. So no worries there. One of the ...
0
votes
0answers
36 views

Creating Secondary Menu - all steps required?

I am using retro hipster theme and have been able to add secondary menu with details. I've read regarding adding array in functions.php and then calling both nav in the header.php. However one menu ...
4
votes
1answer
269 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
0
votes
0answers
65 views

automatically adding submenu items

Here's the solution that @bainternet has posted here: Add child pages automatically to nav menu /** * auto_child_page_menu * * class to add top level page menu items all child pages on the fly * ...
4
votes
2answers
334 views

Menu items (all menus) being deleted randomly on their own [duplicate]

This is really driving me up the wall now. Randomly, all my menu items for all menus are just being deleted on their own. Not the menus themselves but all items within them. This is a custom theme ...
1
vote
1answer
49 views

Which settings/options are saved on a theme-basis and how does this affect theme-switching?

I realized that when switching the theme (in my case to a child theme) some things don't stay the same: Widgets Menus At least this is what I found out so far: Widgets Don't lose widgets when ...
0
votes
0answers
26 views

wp_nav_menu: current_post_ancestor-category parent

I have a nav like this: page 1 -- page 1.1 -- category 1.2 page 2 page 3 When I am on a single post in the category 1.2, the category-menu-item gets the correct class current-post-ancestor and ...
0
votes
0answers
53 views

Post label “new!” in wp_nav_menu using class?

I'm looking for a function to add a "new" label in front of my custom post type name in my navigation menu. The code is : <?php $args = array( 'numberposts' => '1' ); $recent_post = ...
2
votes
0answers
119 views

All Menu Items Disappear Seemingly at Random [duplicate]

For the last month or so, seemingly at random and with no discernible pattern, my menu disappears. However, when I look at the Dashboard, what I find is that all the menu items have been deleted but ...
1
vote
0answers
36 views

Unlimited WordPress Menu

I am limited to like 80 menus. My menu consists of 1000 menus. How can I increase the limitation of Appearance > Menu I tried modifying the php.ini (using reseller account) and increase the max_var, ...
0
votes
0answers
21 views

how to proceed for a “new!” label on menu_nav? [duplicate]

I'm developing in Wordpress and would like to assign the label "new!" to specific custom-post-type's (not necessarily all post-types) if they contain new posts in the last 30 days. I found this code ...
0
votes
0answers
34 views

When submitting more than 200 menus, I get “Service Temporarily Unavailable”

I have a site with a large number of nested menus. I solved the problem after following the solution proposed here Menu limit, cannot add new menu items and including max_input_vars setting. For ...
0
votes
2answers
148 views

Override custom menu widget

I would like to override some mark-up and css (like <div class="soma_container"><ul class=""></ul></div>)styling on a chosen custom menu widget. How would I do that? Should be ...
0
votes
1answer
152 views

Theme: Twenty Thirteen Mobile Sliding Menu Doesn't Bump Content Down

I have created a child theme for Twenty-Thirteen and somewhere while editing it I broke the mobile menu slider as it no longer pushes the content down and instead displays behind the content. I've ...
0
votes
1answer
59 views

Use wp_nav_menu to display ALL pages

I am currently building a wordpress theme. For the menu, I just want to display all the pages that are created in the order that they are created in (i.e. I don't want users to have to go into the ...
0
votes
1answer
1k views

Custom Nav Walker sub-menu HTML construct

I've got my Custom Nav Walker set up and it works fine with the main menu items, and displays them how I want. However the same HTML is being applied to the sub-menu elements which isn't what I want. ...
0
votes
1answer
39 views

Add a string after each item in Wordpress sub menu

I am trying to add a special character to display a » alongside each menu item in Wordpress. So for example About us » Contact us » And so on... Here's my code <li><?php echo ...
0
votes
2answers
245 views

Current menu item

I'm trying to figure out why my text is not showing white as it should. I'm overriding bootstrap.min.css in style.css the current-menu class in Wordpress, but no success. It highlights the right ...
0
votes
1answer
34 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 ...