Skip to main content

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
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 ...
0 votes
1 answer
688 views

Automatically add CPT UI categories to the menu

I have created a CPT UI and selected built in taxonomies "categories (WP CORE)". I have added some records and every time I add a category and main record, I want them to display in the main menu ...
0 votes
1 answer
969 views

How do I hide submenus from the top menu bar?

My website is wiki-style and has a lot of pages that should only be reached through links on other pages. Having these all accessible from the top menu bar under their respective headings leads you ...
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 ...
2 votes
1 answer
1k views

How to display dynamic content in start_lvl function

I am creating a custom nav walker but having trouble outputting parent menu item title in start_lvl function. I want to output it right after the <div class="dropdown"> in the following ...
0 votes
2 answers
1k views

How to remove an item from a custom Walker_Nav_Menu

I have a custom menu on a wordpress + woocommerce site using the Walker_Nav_Menu class. When hiding posts (products) from the site those posts and category are still included in the custom menu. I ...
0 votes
1 answer
693 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
1 answer
2k views

Programmatically set current-menu-item using wp_nav_menu

I'm calling wp_nav_menu programmatically on a class and I'd like to be able to set the field that will be shown as the current-menu-item but I don't see an argument for that. It seems like I may be ...
0 votes
1 answer
6k views

Appearance --> Menu -not showing on my main page

I have created menus (Appearance ---> Menu) and they are not showing up on my website. I am running the Kingdom Theme. Please help and keep in mind i am new to this. Thanks in advance!
0 votes
1 answer
2k views

Show Sub Menu on click and not hover

I have a menu in which I am trying to get the sub menu to appear on click as opposed to hover. I have the hover styles set and working so when I hover the sub-nav appears as a block element. Not ...
0 votes
2 answers
15 views

How to build help pages similar to Wordpress Developer Resources

We need to build a help page similar to Wordpress Developer Resources (see the screenshot below). We're problably looking for a developer solution as we haven't found any plugin that would fit our ...
0 votes
2 answers
917 views

Add custom WordPress admin page with pretty url via code

WordPress add_menu_page and add_submenu_page support adding custom page. The page created have url with a slug similar to wp-admin/admin.php?page=our-custom-page How can create a admin page which ...
1 vote
2 answers
2k views

Set default screen option for appearance -> menus

Is it possible to have any control over the screen options for Appearance>Menus. I am working on a theme and with a fresh Wordpress install where I had never touched any of the screen options ( at ...
0 votes
1 answer
5k views

Add Featured Image and Title to wp_nav_menu items

I like this solution from Ahmad M, a lot, but how do I add images in addition to titles, instead of replacing titles? (Sorry, I'm still pretty new to PHP and Stackexchange). Pulling Featured Images ...
0 votes
1 answer
724 views

How to add all subcategories as submenu in WordPress menu

I've more than 450+ WooCommerce product categories and subcategories. I want to add them all in the menu items, categories as a top level menu and subcategories as submenu. Is there any way to ...
0 votes
1 answer
728 views

Show all parent pages and their children below from same author as currently viewed page

I am trying to create a section on my page template that displays all the parent (top level) pages with its children listed below but only by the same author of the currently viewed page. I have this ...
1 vote
1 answer
5k views

wp_nav_menu() doesn't work

I'm working on a theme with custom menus, currently using WP 4.0.1. I'm registering two menus in functions.php: register_nav_menus( array( 'primary' => __( 'Main Menu', 'wsy' ), ...
0 votes
1 answer
2k views

Sub Categories in drop down menu

I have lot of categories and sub categories. I want to add all these in WordPress menu. But i want to add subcategories aligned properly under their parent categories without drag and drop each and ...
1 vote
2 answers
986 views

Multiple languages menus problem

I'm trying to add language option to my website. I've coded my theme and I need to show the web in three different languages. I've got the little flags and I've managed to pass a php variable with the ...
0 votes
1 answer
750 views

How to remove top menu item and font awesome icon in WordPress menu?

In my WordPress menu I have a top or header menu item. I know how to find it and use CSS to hide it, but that's not exactly what I want. At the moment I have menu bars which, when pressed, go to fa-...
6 votes
6 answers
7k views

Add separator to admin submenu

I would like to add a separator to the admin submenu section, NOT in the top level section. I'm thinking of using javascript and styling to do the job, but I was wondering if there's a more ...
1 vote
1 answer
884 views

wp_nav_menu doesn't seem to work on custom post type pages

I'm working on something someone else set up, and on the index page, the nav appears, but on custom post type pages, it does not. The nav menu: wp_nav_menu([ 'menu' =&...
0 votes
1 answer
941 views

All custom links suddenly lack href attributes

Short version: before updating to WP 4.5 and on a day when the only known change was adding a page to a submenu via the navigation menu admin all of the menu links of type Custom Link where we specify ...
0 votes
0 answers
19 views

There is no option to click the button in header only on some pages

I have tried to solve this problem on my own but nothing works for me. 1 scn - On the main page https://customqualitymanufacturing.ca/ when hovering over the Products button in the header everything ...
1 vote
2 answers
816 views

WordPress Plugin menu position overwrite other item

i've got a question. I created a plugin with a menu and i want to show this under the Dashboard menu-item. In some of my wordpress installations the dashboard item will be overwrited. How can i fix ...
0 votes
1 answer
820 views

Active menu item state on all menu items

My homepage is type of onepage site and I've created menu with anchor links for it, where users can navigate through sections. When user is on subpage, for example listing of posts and clicks menu ...
3 votes
1 answer
1k 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 ...
0 votes
1 answer
1k views

Always show wordpress submenu on responsive header menu

I'm trying to edit my CSS to always show all the li tags inside my header menu, also with ul.sub-menu li; I just want to show all the items from the menu, but I'm working on it for hours and I've ...
2 votes
1 answer
1k views

Add code to WordPress menu items by class

I am trying to add onclick="toggle_visibility('sub-menu');" into the opening tag of specific menu items generated in WordPress. I have used the following function to target all parent menu items ...
0 votes
1 answer
898 views

How to remove a sub-menu using walker hooks/filters without relying on a custom walker?

I currently built a pretty simple tool to create a mega menu. I add a checkbox to my menu items in the Appearance > Menus section followed by a dropdown that includes template files within the theme. ...
1 vote
1 answer
1k views

How to avoid a duplicate query from using wp_nav_menu?

My theme need to render 2 menus in homepage. The rest pages only need one. As result is only homepage got duplicate query warning. After tracking down, I found out this was cause by wp_nav_menu. How ...
7 votes
1 answer
2k views

Registering menu with 'Automatically add new top-level pages to this menu' selected

Is it possible to register a menu inside of a theme functions file and have 'Automatically add new top-level pages to this menu' pre-selected? I can't find any info about this in the ...
0 votes
2 answers
710 views

Styling Active Links Within Wordpress

I wish to style the active link (ie. when home page is selected that the home page link be a different colour) .current-menu-item a { color: #36c; } My test site is : www.milknhny.co.uk/ShopTest I ...
0 votes
2 answers
1k 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 ...
1 vote
2 answers
698 views

Getting the current menu item id from specific menu

I'm trying to get the current-menu-item-id in any page. I have used this solution, that brings me very close to the solution. The problem I have is, that the function below is going through all the ...
0 votes
1 answer
1k views

wp_nav_menu seems to be printing the wrong menu

I'm learning WordPress and I'm can't understand what I'm doing wrong with a theme I'm creating. Here is how I create my menus in the functions.php file function my_custom_theme_setup() { ...
1 vote
2 answers
2k 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
743 views

How I can overlap my menu in my header picture

How I can overlap my menu in my header picture. I want the menu can be seen on the header picture. This is the example like I want. Thank you. Example :
0 votes
1 answer
714 views

Wordpress menu issue after update

INHERITED WEBSITE - I'm taking over an existing Wordpress website (prepwellness.org) and I noticed several things wrong with the Wordpress GUI. 1) It didn't have a "Posts" option in the left ...
3 votes
2 answers
776 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 ...
0 votes
2 answers
1k views

How can I click the parent menu then redirect to a special URL?

You see I have a Navigation bar items, in the parent item Products & Services with two sub menus. I have a requirement, when I click the menu item Products & Services it redirect to its sub-...
2 votes
1 answer
2k views

Multiple navigation menus to a location?

I want to be able to assign multiple menu's to 1 navigation location. But when I want to assign the second navigation, the previous is unassigned. How would it be possible without breaking the ...
0 votes
2 answers
3k views

display content in multiple columns

I am Creating a Multi row , 2 Columns blog Post like this Post #1 | Post #4 Post #2 | Post #5 Post #3 | Post #6 I have found some post useful https://digwp.com/2010/03/wordpress-post-...
0 votes
1 answer
3k views

Getting parent object_id of child menu items in WordPress menu

I am building a menu for a client that grabs custom field data from the top level menu item's pages and adds data-color to that menu item. I have that part working no problem. The issue I'm having is ...
3 votes
1 answer
2k views

Add div to specific sub-menu

I researched in google, yandex but had no success. With this code I can set a div to sub-menu but this code add to all sub-menus, I just need to add div to specific sub-menu. class Megratron_div ...
0 votes
1 answer
922 views

wp_nav_menu not selecting teh correct menu

I'm having a weird issue. I have 2 menus, and registered them in functions.php, like this: add_theme_support( 'menus' ); register_nav_menu( 'primary', 'Top Nav' ); register_nav_menu( 'footer', '...
3 votes
1 answer
1k views

Automatically Add New Tags to Sub-menu

Been searching for any related plugins or info. about this case but didn't find anything relevant or working. I need every new tag that is added to a post automatically appear in a menu as a sub-menu ...
0 votes
1 answer
728 views

How limit the width of a fixed menu-bar on scroll?

my primary menu-bar has transparent background. To have the menu visible always on top I looked for a solution and got the 2 codes you see below. This code works fine, except the width of the menu-bar....
0 votes
1 answer
3k views

Removing wp admin menu item on top bar of admin backend

I have managed successfully to remove the not needed menu items for user role 'editor'. Now I have one item left on the top bar that makes Editor add new post page and other items which I need to hide....
0 votes
3 answers
1k views

Wordpress menu issue - if there are child links partents won't click

I am working on this site for my own business and when I create a menu with child links, as per below image, only last child of that drop down menu, it actually clicks and loads a page. If I click ...

1
2 3 4 5
65