Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
12 views

Menu button to swap out shortcode somewhere else on page - is that possible?

Using WordPress 4.9.8, Windows 10 and Elementor Pro 2.1.9 plugin I’m very new to WordPress. I like to have a menu button that when activated replaces an iframe [shortcode] within the current page ...
0
votes
0answers
6 views

Trying to make a dropdown menu with closebtn. please help

I am new to coding in WordPress. I am actually making a custom theme where I want a dropdown menu in header. I like Moz.com and Neilpatel.com's drop down menu so much. I tried to code one like that ...
0
votes
0answers
10 views

Wordpress “Appearance > Menus” blank. Not showing any menus

All of a sudden the "Appearance > Menus" went blank. I opened this project just a couple of weeks ago. Have not had any problems until now. See screenshots. Same for "Manage with live preview" I am ...
0
votes
0answers
11 views

How do I remove my social icons in mobile navbar?

In the mobile view on my website, the social icons are stacked on top of each other and are conflicting with the dropdown in my menu. I have tried targeting them with @media (max-width: 768px) and ...
0
votes
1answer
20 views

How do i make a custom top level dashboard menu item available for all users?

I'm trying to add a top-level menu-item to all of my users their Wordpress dashboard. With the code I'm using the menu item only show up for me, the admin. add_action( 'admin_menu' , 'edit_page' ); ...
0
votes
1answer
14 views

Display_name in menu

I'm trying to display the "Display_name" of an user in the menu. So I created a menu item called "#profile_name#". It's working when i'm logged, but it displays "Untitled" when i'm not logged. Do you ...
0
votes
0answers
16 views

wp_nav_menu_items returns only a singly menu item

I try to retrieve the the list of my menu items and print them using the function wp_get_nav_menu_items() but this function return just an array with a single item not all the items I have in my main ...
0
votes
1answer
14 views

wp_update_nav_menu also triggers post_updated

I have built a little script that indicates if one specific element should be taken from a cache instead of a query. I started with an action triggered after each post update like this: function ...
0
votes
1answer
18 views

Change menu for mobile

I am working on a WordPress website, where I try to show a different menu based on the device (desktop vs. mobile). In order to do that, I added some code to the header.php file: <?php ...
0
votes
0answers
25 views

How to create custom post type selection to nav menu

I added a custom post type in my navigation menu. with this code register_post_type( 'post_type_name', array( 'exclude_from_search' => false, 'label' ...
0
votes
1answer
26 views

jquery plugin won't fire when hamburger class element clicked

I have a company WordPress website developed by a vendor where customers making online payments get navigated to a third-party website to manage that. Initially, we had direct urls built into the ...
-1
votes
2answers
58 views

Make menu bootstrap compatible

I am having an issue with my WordPress nav menu. It is currently looking like this : I am trying to make my bootstrap 3.3.7 (think that's the right version) menu work and that is the error. The line ...
0
votes
1answer
23 views

Highlight inner post menu current item

WordPress has a built in feature that assigns the class “current-menu-item” to the current navigation item. Nevertheless, that feature only works for contextual menus; and not for the ones inside the ...
0
votes
0answers
9 views

a vertical menu for categories with a complicate database

I want to create a vertical nested menu from my posts. these posts have some categories. one category is for the province and its cities as subcategories. and another category for type of post for ...
0
votes
0answers
13 views

How to post images in a menu without it being a post or page?

So I created a menu with a form where people can send me pictures and videos and now i want to post that images and videos to a menu each time the y send me a file, but I don't want it to be a post ...
0
votes
1answer
21 views

WordPress Menu item > Sub menu Class update

I'm a newbie to WordPress core and development process. As I have a little knowledge of WordPress functions. But I need the help from you guys. Actually, i'm developing my first theme and i already ...
1
vote
1answer
17 views

Pass GET params to URL from a main menu item

I have a booking form on page "Training" and I want it to be pre-filled with logged in user's details. For that I need to pass those details (name and email) to URL and the form should automatically ...
0
votes
0answers
15 views

Auto populate menu with posts in Wordpress

Well, I've been searching for a while on how to do this with no luck. Maybe it's simple, maybe I don't know what keywords to use to find the solution, but I'd be really grateful if someone could help ...
0
votes
1answer
13 views

Increase wordpress menu Depth

i want to increase my nav menu depth as its only showing upto 3rd level. current is wp_nav code: <?php wp_nav_menu( array( 'theme_location' => 'main_menu', 'container_id' => 'navbar-collapse-...
1
vote
1answer
30 views

HTML Bootstrap navigation menu to Wordpress menu using wp_nav_menu

I am trying to convert my existing HTML Bootstrap menu into Wordpress theme menu. I already created menu called "Primary" in Wordpress, but can't get it in theme exactly the same as in HTML. My HTML ...
1
vote
1answer
32 views

Missing Menus Structure

When I go to update my menu via Appearance → Menus, the "Menu Structure" on the right is completely missing. So I'm unable to update my menu. The Pages section is there, but no "Menu Structure". Has ...
0
votes
0answers
8 views

How to add drop-down feature to a custom menu in Twenty Sixteen theme?

I need some tips on how to turn a custom menu to be a drop-down menu. The menu needs to be positioned horizontally inside the green bar (whereas the default nav menu would be right where the header ...
0
votes
0answers
12 views

Action after menu update - best practice?

When I update one of the menus of my blog I'd like to save the navigation array (the one you get with wp_get_nav_menu_items) in a static file so that I can call this static file from the site instead ...
1
vote
2answers
60 views

Highlight the “Home” / “Blog” button while on main page

I have been trying desesperately and in vain to highlight the button I have for "Blog" whenever I am in the the main page (I had created a custom link with my homepage)...it is really driving nuts! ...
1
vote
1answer
26 views

Wordpress sub-menu items suddenly not showing

None of my submenus are showing. They all show up in Appearance->Menus, but not on the actual website. I've deactivated all of my plugins so it's not being caused by that. Help? Website: http://www....
1
vote
1answer
11 views

How can I access the menu ID of an element in a Wordpress Nav_Walker

Using this code as an example (from another post): class Primary_Walker_Nav_Menu extends Walker_Nav_Menu { function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { ...
0
votes
1answer
25 views

Limit wp_nav_menu_objects() only to first-level menu items

I need to alter my menu URLs and add "/" to the beginning on every page except homepage. It works well using this piece of code: function change_menu($items){ if(!is_front_page()){ ...
0
votes
1answer
26 views

How to customize navigation menu in theme which is converted from pure html theme

I am trying to convert a pure html theme to wordpress theme. I need to know how to make the navigation menus in the html theme (now it is on the way to converting to wordpress theme) for functioning ...
0
votes
1answer
27 views

Adding top level items in the admin menu that link to a post

I'm trying to add top level menu items (not sub-menus) to my WP admin menu that link to edit a post. The reason for it, is that I have different sections and custom post types, so I'd like to have ...
0
votes
3answers
35 views

Register a menu - Error Header

Could someone have the same error when im trying to register a menu? function.php function register_my_menu() { register_nav_menu('header-menu',__( 'Header Menu' )); } add_action( 'init', '...
0
votes
1answer
29 views

Highlighting Active Page in Navigation when Viewing Child Pages

I am trying to do something seemingly simple. I have invested a good amount of time researching and have not been able to resolve this one on my own. I would like to have the "Portfolio" page of my ...
1
vote
1answer
35 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 ...
3
votes
2answers
36 views

Adding Custom Link anchors in the top menu that points to specific sections of the site home page

My site is using a nav menu in my custom theme. I want to add navigation links to anchored links that points to specific sections of the site home page using a Custom Link in the nav menu. I want to ...
0
votes
0answers
24 views

Targeting specific page or custom link in menu

I am outputting all my pages and custom links with this code: <nav class="site-nav"> <?php $args = array( 'theme_location' => 'primary' ...
1
vote
1answer
26 views

How to use buttons elements for tgetWordPress menu items?

How do I mix HTML element types for a two-menu navbar? I am building a WordPress theme with Bootstrap 4. WordPress' menu contents should be sourced from the Menus options, output in to a Bootstrap 4 ...
1
vote
1answer
20 views

How to handle many different menus?

I'm developing a site that has about 200-300 pages, that each needs a custom side-menu, linking to primarily internal pages. So here's one sidebar: Link to /foo Link to /bar Link to www.example.org ...
0
votes
0answers
11 views

Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?

I am trying to see if there is a way to have the sub-menu items change depending the taxonomy of the of the page that is in the menu? I currently use the following WP_Query I use to grab the top three ...
0
votes
1answer
9 views

How to make certain posts not appear on the main page, but instead only a newly created category(in the menu section)

my question pertains to the wordpress.org platform. Recently i created a new category for my posts(called reviews) and added it as a part of the menu. Basically i wanted to send all the book reviews ...
0
votes
0answers
16 views

Can't seem to override start_lvl & end_lvl in Walker_Nav_Menu class

Can Anyone tell me why I can't seem to override this class. Here's my wp_nav_menu function build_topbar_nav() { wp_nav_menu(array( 'container' => false, 'theme_location' =>...
0
votes
1answer
31 views

Add class to specific li item menu in function.php

I wish to add a class to a specific item of my primary menu. I'm using this: function hideMenuItem ( $atts, $item, $args ) { $commerce = get_field('ecommerce', 'option'); if (!$commerce){ ...
1
vote
2answers
135 views

Theme menu in Admin Panel

I am new in WordPress Development. How can I get Menus in Admin Panel like below ? I am trying to develop a theme. But I couldn't display that.
0
votes
1answer
32 views

Wordpress customizing a walker menu class

Hey Folks I trying to customize a wordpress walker class to add custom classes to navigation level. Essentially there will be 3 levels of navigation. Here's the code: <ul class="rd-navbar-nav">...
0
votes
0answers
32 views

Walker Nav Menu Depth

I've been looking for a way to add spans to my mobile menu so they can be targeted with jQuery. I found a custom walker_nav_menu and it works well and adds a span to menu items which have children. ...
0
votes
0answers
26 views

Change Menu Item's URL according to Category selected

I don't have wordpress development experience, so pardon me if this question is lame. I want to achieve following behaviour in the wordpress menu: I want user to select a country, then have WordPress ...
1
vote
1answer
22 views

how can remove this element to avoid having two menu buttons with one that shows unnecessary pages

I like the menu buttons when the website is viewed in the desktop view but I don't like it whenever it is viewed in the mobile view. it brings two menu buttons and one of the buttons shows unnecessary ...
0
votes
1answer
38 views

Add class to active top level (grandparent) menu item

I'm building a site with a mega menu. Here's what the structure looks like: <ul> <li class="active-grandparent">Grandparent <ul> <li>Parent</li> <li&...
0
votes
1answer
14 views

Menu with category 2 category combined

I need to create 2 category menu in my wordpress site. One in the sidebar, one in the content. In the content I need to have only ingredient menu, so fish chicken ...and so on. In the sidebar I ...
0
votes
0answers
128 views

Menu with category combination

I need to create a menu with category combination. My need is to display recipes category for principal ingredient and first or second dish. I need to associate category to a single ingredient and ...
1
vote
1answer
24 views

Variables within wp_nav_menu

I have a left and right wp_nav_menu which displays on the front-end as one unordered list: <nav> <ul> <?php // Left menu wp_nav_menu( array( 'theme_location' ...
1
vote
1answer
35 views

header menu structure: cannot add additional menu items without alignment issues

When I add a new menu item to the header menu there is an alignment issue (please see the image). I'm not exactly sure which part of the header.php file to modify to address this problem. Update - ...