Questions tagged [menus]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

menu mobile show up even i in desktop mode in Newspaper Theme

I have WordPress website with Newspaper Theme and I have a problem with the Menu. Link: demo2.tmanow.net I have 2 problems: The menu mobile show up in left side even i in desktop mode, this not ...
1 vote
2 answers
728 views

I want to hide the navigation menu on a particular page

I want to hide the navigation menu on a particular page. I know how to find the page id, but I am clueless about how to find the rest of the stuff, it would be great if someone could look into my blog'...
0 votes
2 answers
27 views

Hide menu items from not logged in users

I have a theme which automatically adds all published pages to the menu. Is there a way to override this and add some of the pages only when the user is logged in? I thought maybe there is a filter ...
0 votes
1 answer
1k views

List all posts from custom post type by taxonomy

Having custom post types with taxonomies. Lets say I have a custom post type "Products" with taxonomies "new", "old", "fashion". Now I have a Nav where I can click on wordpress.private/products/new/...
2 votes
1 answer
1k views

Create Dropdown menu Using wp_nav_menu() function

Kindly provide me wp_nav_menu structure to create the following dropdown menu. <div class="container"> <div class="nav-menu"> <a class="toggleMenu" href="#">Menu</a> <ul ...
0 votes
2 answers
2k views

Need help with adding custom wordpress menu and sub-menu

I've got my HTML Custom Nav set up and it works fine for static template. I want to convert it into wordpress navigation menu. I am totally new to wordpress and i want help to convert html menu to ...
1 vote
1 answer
1k views

Is this best practice for Dynamically adding items to WordPress menus?

Is there an easier way too add this functionality to the menus page, instead of using the following code? Another words a different filter/hook/action that will make it, so I don't have to write ...
0 votes
0 answers
12 views

Menu drop down covers contents of page in Mobile view

Hi folks I want to try fix my menu. When on a mobile device I click the burger menu. Its expands but it partially coves up the contents of my pages or posts. Is there a workaround for this ? The ...
0 votes
1 answer
808 views

Custom Class to wp nav menu

I am trying to edit the default arguments in the wp_nav_menu function. Basically I need to add a custom class to the UL and a custom class to the LI. I have tried to use <?php function ...
0 votes
1 answer
1k views

How to retrieve a Menu Name by Menu Location with ACF fields

What WordPress function can be used to retrieve a Menu Name using the Menu Location as parameter?
1 vote
0 answers
18 views

Is there a way to eliminate flyout menus when adding a post?

It seems like each new version of wordpress adds more intermediate menus and menu options than the previous. Particularly heinous examples include the Preview button with its form-factor checkboxes, ...
0 votes
1 answer
3k views

How to use Bootstrap Navbar in wordpress Nav Menu

Here is my code. <?php wp_nav_menu(array('theme_location => 'primary',)); ?> How to format the code in my header.php using the bootstrap navbar? I am using bootstrap 4.3x. I am new to ...
0 votes
0 answers
20 views

How to replace hamburger icon with "Menu" text?

My client has asked me to replace the hamburger icon in the mobile menu with the text "Menu", because he finds it more intuitive. I'm using the WordPress theme Kumle. In the file "...
1 vote
1 answer
791 views

Change submenu markup

I've seen people recommending to edit the wordpress default Walker to change the menu markup and create your own. The problem with this is that I would like to change the markup of the submenu and ...
0 votes
2 answers
4k views

Menus not visible in Appearance after being registered

The menus have been registered in functions.php, but they don't appear within the Appearance > Menus section in Admin and the pages, posts etc options are greyed out. The menus are saved, as you can ...
0 votes
3 answers
1k views

Get menu items problem

I'm trying to get a menu items created from wordpress admin panel. To do this I followed the instructions codex: http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items // Get the nav ...
0 votes
2 answers
2k views

Menu Button that link to different pages for unique user?

Is there a way to create an menu button that link to different pages to each unique user? So far I have used the plugs-in: User Specific Content, Peter's Login Redirect and Them my Login. Basically, ...
0 votes
2 answers
2k views

wordpress walker add class to submenu a href

I am having some troubles with my wordpress walker code. I know it's possible to add a custom css class manually via the admin menu section. But what i am trying to achieve is to get this done ...
0 votes
1 answer
1k views

Walker_Nav_Menu Add Strings and Class Name

How to make this pattern using Walker_Nav_Menu? <ul class="nav navbar-nav"> <li><a href="portfolio.html">Portfolio</a></li> <li class="dropdown"> ...
1 vote
2 answers
4k 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 https://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, ...
0 votes
1 answer
991 views

Adding widget to sidebar which contains current page's submenu

Need to insert the sub menu of the current page into the current page's sidebar. Is this possible? What I'm interested in developing would be a menu that looks like this: menuItem1 => subitem1, ...
1 vote
0 answers
17 views

Custom loop menu is not working

I am using the below code to create a custom WordPress menu for mobile. With this code, nothing is return. Even the menu is not retrieving. Can anyone assist me with this? This is a multilingual ...
0 votes
1 answer
1k views

Menu items do not “open” when mouse hover over them?

My site is very old now and has worked fine up until the most recent WP update. My menu items do not “open” when mouse over them? I can see that the theme uses Superfish but can't find anything that ...
0 votes
3 answers
4k views

how do you create this customize menu using wp_nav_menu function?

how do you create this customize menu using wp_nav_menu function? function.php file register_nav_menus( array( 'header-menu' => 'Header Menu', 'footer-menu' => 'Footer Menu' ) ); ...
2 votes
1 answer
1k 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 ...
0 votes
1 answer
2k views

Add parent menu item in sub-menu in custom nav_walker

Currently I'm working on a project where we need to append the parent title as first item in the submenu for a mobile menu. What I try to achieve is this: <ul class="menu"> <li> ...
0 votes
1 answer
1k views

Add newsletter signup element to navigation bar

I've been researching here and on other dev/WP sites to find the best solution for adding what is effectively a custom element to the navigation menu, and it seems like there are many approaches. ...
1 vote
2 answers
2k views

wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu

<?php wp_nav_menu(array( 'theme_location' => 'primary', 'container' => 'ul', 'menu_class'=> 'top-menu' ...
1 vote
1 answer
1k views

Remove nav menu item by script

I want to create my custom nav menu using a script in a wp plugin. I'm almost there using this tutorial. All I need is the option to delete menu entries. something like wp_delete_nav_menu_item($...
0 votes
2 answers
976 views

Unable to edit Navigation bar

I should first mention I am fairly new to wordpress and web development. I was given the task to update an existing site which includes the navigation bar. I have been digging through code trying to ...
3 votes
2 answers
1k views

Any way to use classic Menus in Full Site Editing?

I use an FSE theme and as you might know the Navigation block is pretty limited. I want to implement a custom mega-menu-ish navigation for a big website. Is there any way to enable the Appearance->...
0 votes
2 answers
941 views

Add a data attribute to list item element in menu

Looking to add a data attribute to a list item in a menu, I can see that some threads on here can add it to the actual <a> link tag, I am looking to add it to the list item itself <li> So ...
0 votes
1 answer
895 views

How to separate sub-menu output and keep associated with parent

I am creating a menu like this https://squareup.com/ I have the html,css, and jquery ready. Now, I am trying to: Create the menu items with it's sub-menu items via wp-admin -> appearance -> ...
1 vote
2 answers
2k views

How to wrap the list with custom class using wp_nav_menu?

I want to display 4 column footer menu. but when I add new menu the wp_nav_menu create a < li > and add every menu items to it. now, how can I wrap every li element with a custom div tag with a ...
0 votes
1 answer
1k views

How to change navwalker's dropdown mark-up?

I am using this Bootstrap 4 Navwalker, bs4navwalker, to step through my WordPress menu items and generate a navbar, like... Single level - works <?php wp_nav_menu([ 'menu' ...
1 vote
1 answer
1k views

current-menu-item class in CSS

I have created one main Page(Home Page) and many custom links in wp-admin. All custom links are linked to sections of Home Page. Example: Custom link About Us has a URL = #section1 and in my code I ...
1 vote
1 answer
2k views

Dynamically add sub menu items

I have been able to add menu items with this statement, this however creates a flat menu. The menu has been created already. I just need to add items. wp_update_nav_menu_item(4, 0, array('menu-...
1 vote
0 answers
8 views

Wordpress menu disappears in category pages

I have a custom query to order and display posts in my functions.php, and I noticed that the navigation menu disappear in those categories! function my_filtro_ed_ordine( $query ) { if ( ...
3 votes
1 answer
770 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 ...
1 vote
2 answers
995 views

wp_list_categories in in nav_menu

I have a website and I want to add automatically categories to my menu. I mean when I create new category it should appear in my menu. How I can make it? <?php wp_nav_menu( array( '...
0 votes
0 answers
20 views

How to Remove Parent Page menu slug from WordPress Submenus?

By default, WordPress adds a parent menu slug to submenu items if there are three or more nested submenus. I want to remove that. For example, in the above case, the "service" menu has ...
0 votes
1 answer
1k views

Wordpress site hamburger menu toggle not working

When I shrink down the browser to test for mobile responsiveness, the hamburger menu does not open, even after I clicked on it. I have tried everything from troubleshooting my plugins to searching all ...
1 vote
1 answer
1k views

Hide product categories and taxonomy terms in menu if empty

I've been researching this and had no luck so far. I have a WooCommerce store with a main menu showing product categories (product_cat) and brands (yith_product_brand) which is a custom taxonomy. I ...
1 vote
2 answers
1k views

add_action does not call the function

I want to add a custom field in the menu, therefore I am trying to use wp_nav_menu_item_custom_fields. I am using following code but it does not even call the function. I am adding it in a plugin, why ...
3 votes
1 answer
774 views

Add Menu items description via Custom Walker for wp_nav_menu()?

Here is a solution I've found, and it works to append a description after the link. My question is: Is it also possible to append a description before the link? function add_description_to_menu($...
0 votes
1 answer
1k views

Creating custom vertical menu

First of all sorry me for my bad English but isn’t my native language so I’ll do as best as possible to explain my problem. I want to create a custom menu with Walker_Nav_Menu that should look like ...
0 votes
1 answer
2k views

Custom menu with categories and tags

Basically I need a custom menu consisting of two level. Top level will consist of available categories, possibly with added feature that each category name is follow by the number of posts in that ...
3 votes
2 answers
111 views

How to get and set post meta for core/navigation-link?

I'm extending a plugin that updated nav menu items with post meta data. This was previously done via Appearance>Menus and Appearance>Customize using wp_nav_menu_item_custom_fields and ...
1 vote
1 answer
3k views

Menu custom link not working for external site

I've got this header menu in my site (made editing a theme), but i've noticed that the custom links pointing at local anchor section (like #section) correctly navigate in the same page to the desired ...
6 votes
2 answers
655 views

Link to Author archive from Navigation Menus in dashboard?

I'd like to display a grid of authors on my site showing the name of the author and their avatar. The tricky part is, I'd like to be able to control this from the Menus page in the dashboard so I have ...

1
2 3 4 5
65