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
8 views

Create a WordPress menu with many levels without using the walker class or wp_nav_menu from scratch

SPOILER: it works nicely only if you have a two levels menu Here's my problem. My goal is to build a Wordpress menu from scratch, without the support of the walker class or the classic WordPress menu....
0
votes
0answers
9 views

Create a default parents for children pages that have the same parent in the menu

Here's my problem: I'm building a website and my goal is to create a nice menu that will interact with the pages. So far so good, except for one problem. The structure of my menu is something like ...
0
votes
1answer
21 views

Cold Fusion to Wordpress

I've been tasked with moving a website from cold fusion to wordpress. In the old site there are several templates that are brought into the site via cfinclude. I've coded most of a custom wordpress ...
0
votes
0answers
11 views

Toggle dropdown no text visible [on hold]

I'm a totally layperson concerning CSS. I ask for understanding. Here's my problem. When I click on the Menu on a mobile device there's no text appearing in the dropdown menu (theme Wordpress Twenty ...
-1
votes
1answer
25 views

Notice: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in …functions.php on line 73

When I tried to edit my menu, it appeared HTTP ERROR 500 Then I set define('WP_DEBUG', true); in wp-config.php Once I try to save the menu, the following error appears: Notice: Use of ...
0
votes
1answer
19 views

Roles see different top menu (nav menu)

I'm new to WordPress but has some knowledge in HTML, CSS and and a little of PHP. I'm trying to make a new menu in "top menu" that will be hidden to users that are not admin, but will appear to admin ...
0
votes
0answers
15 views

different homepages and one main homepage

I want to create on one website different divisions each with its ows menu and homepage. in other words" I you enter the website that will be the Main Homepage. On this page I want to put 4 pictures....
-1
votes
0answers
13 views

Getting page content from a function?

How can I generate a "custom" page which gets its content from a function? I see there are two functions, add_menu_page and add_submenu_page, but these only work for the admin section. I cant find any ...
0
votes
0answers
11 views

wp_nav_menu() filter - preg_replace value returned wrong

I'm having an issue where the filter I've added to wp_nav_menu() is adding code to the second level of the navigation. How can I change the filter or the preg_replace code in a way that only adds it ...
0
votes
1answer
16 views

Count top level menu items

I need to get count of top level menu items. I have menu with 5 items and of of them has 1 submenu. This is current situation, but the user using the theme I am building may have some different ...
0
votes
0answers
22 views

Menu, but Custom Links? [closed]

I have a http://bla.com/transport/, /wp-admin/nav-menus.php Custom Links URL=/transport Navigation Label=Transport And I have a echo "Hey"; I guess it makes any of these: archive-transport.php ...
0
votes
0answers
16 views

Where to place a svg chevron down in my custom walker?

i am a bit stuck with the custom walker in my Wordpress theme. I wanted to place a svg chevron down on the first link when a submenu is detected. My theme uses a svg file with all the svg paths. The ...
0
votes
0answers
14 views

CSS Classes (optional) is not working on the ul li a?

I'm working on the working custom theme development where i need to add custom and additional class to the ul li a i have added extra class using CSS Classes (optional) but problem is that extra ...
0
votes
0answers
14 views

Mark menu item as active for a specific category's posts without using custom post type

I have only one (default) post type on my site. The posts of that type are separated by two categories (as well as tags). The way to approach those posts is not only, but also through two pages shown ...
0
votes
0answers
10 views

Way to collapse pages in menu (explorer style)

I have a menu containing a dozen pages. This menu lives on a widget on my sidebar. I'm looking for a way to collapse this menu, to hide all the pages except for the first one or perhaps the menu ...
0
votes
1answer
19 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
0answers
9 views

Add custom nav walker to UberMenu instead of wp_nav_menu

I am working on a website, that has a custom walker added to an existing nav menu. The code works great for a standard wp menu, but I cannot seem to add the same walker to an ubermenu (www.wpmegamenu....
0
votes
1answer
16 views

code to add an extra selection to the menu editor

I've given up looking for a plugin to achieve what I want (either they don't exist or I'm not using the correct search term) either way this leaves me with two options. Pay someone to make the changes ...
0
votes
1answer
24 views

Custom menu items in admin

I would like to add my own custom menu items to Appearance > Menus. How can this be done? The best way to describe what I want to do:
0
votes
1answer
25 views

Menu is in Reversed order

I cannot seem to figure out why this menu is in reversed order only for Mobile. site-navbar.php <div class="menu-container"> <div class="menu w-full mx-auto container xl:pr-16"> ...
0
votes
0answers
18 views

Add Widget to Nav Walker Dropdown menu

I have successfully created a mega menu using the Nav Walker class and split the drop down into columns using CSS column count. Now I will like to display a widget in another column like so. public ...
0
votes
0answers
13 views

Header and Footer do not appear on pages

I have a custom theme built by a third party and the header and footer both appear as expected when I am logged into admin on Word Press, however when viewing the pages logged out I do not see the ...
0
votes
0answers
17 views

Wordpress Toggle Menu has stopped working

I am using the twentyfifteen theme on my wordpress site. When you access the site on mobile or resize on your browser so that the page height > width, a hamburger icon appears on the upper right. I ...
0
votes
0answers
14 views

Add wrapper for a specific sub-menu

I am trying to add a wrapping div around a specific sub-menu. what is the best way to do it ? is there a way to target the sub-menu and modify it or should i just use 'wp_nav_menu' or '...
0
votes
0answers
13 views

How do I create a navigation menu from product meta (custom fields)

I'm trying to find out how to add a navigation menu to my site based on one set of custom field meta data. I have tried creating tags from the custom field but then all tags are displayed in a single ...
0
votes
0answers
10 views

Changing a default nav menu through a plugin

Is there a way to change the primary nav menu that is at the top of the page, with a plugin. I want to make it so I could switch between menus if user is logged in and which user is logged in. So ...
0
votes
0answers
15 views

Implementing the menu li ID into the ul.submenu using walker and the start_lvl function

I would like to display the menu ID with my prefix (parent) to the ul.submenu within a data attribute. Here's an example of the output I am after: <ul id="menu-main-nav" class="menu"> <...
0
votes
1answer
18 views

Hamburger Menu not working on reduced browser size

I'm currently working on my site but having a small issue with the hamburger menu. It works fine on an actual mobile device, but when I reduce the browser size so that the hamburger appears, nothing ...
0
votes
0answers
11 views

Create customization options using theme customizer API based on the number of top level menu items

I am creating options for my theme, to customize and style menu items trough theme customizer. Each menu item will have its own options to change icon next to it and color. As I don't know how much ...
-1
votes
0answers
18 views

Custom code for different menus sector page logo

I'm trying to add a different logo on wordpress website for a specific page- https://mdcgroup.ba/ the developer before me added already different logos to menus / different sectors in function.php ...
0
votes
0answers
9 views

Assign multiple user created menus to one theme location

I know what I am asking is probably out of the scope of Wordpress's ability but anyway. My issue is that I need to assign multiple menus to a single theme location (the dynamic location), I have set ...
-2
votes
0answers
15 views

how to stop calling same menu twince in wordpress? [duplicate]

Can someone help to remove calling the menu twice ? this is very annoying and I didnt know how to fix it from menu-mobile.php or header.php or any other WP files. This is an error in theme, and I ...
0
votes
1answer
18 views

Prevent more than 2 level menus in dashboard?

In my theme I have menu for max 2 levels. Now I want prevent to create more than 2 levels menu in admin dashboard. Is there any way to do that?
0
votes
0answers
17 views

Changing menu icons

I have four navigation menus in the widget area at the bottom of my page like this: - They don't look very nice and my current theme doesn't allow me to change the styling much. I'd like to change ...
0
votes
1answer
35 views

Convert HTML code to WordPress menu

I have this HTML <div class="navbartop"> <a href="/">Home</a> <div class="subnavtop"> <button class="subnavtopbtn">Alfabetic <i class="fa fa-caret-down"&...
1
vote
1answer
10 views

Default Wordpress menu content

I have several menus in my theme, but if I don't create menu in dashboard, then in those menus is displayed default menu. How can I avoid that? I don't want any menu content until I create one. This ...
0
votes
0answers
14 views

Cannot attach angular trigger to menu

I'm using Off-Canvas Sidebar to house my menu, but Frontier Post andAngular to handle display and sorting of my posts. How do I implement the js sorting trigger instead of the standard php menu link?
0
votes
1answer
24 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
0answers
9 views

Custom menu not working. Don't show the option “Menus” in appearance

The links of custom menu is working, but in the wp-admin not screen the option "menus" in Appearance. I've tried many options, but none have worked so far. The links of custom menu work. function.php ...
0
votes
0answers
17 views

post_type to Menus

I have a get_template_part('transport'); to index.php transport.php: <?php $args = array( 'numberposts' => 10, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', '...
0
votes
0answers
29 views

Problem with Mobile navigation menu with wp_nav_menu() function in WordPress

Here is the problem. I'm creating a theme in WordPress and I have trouble with dinamic navigation menu on Mobile devices. Here is the code which I use: <nav id="primary-menu" class="navbar navbar-...
0
votes
0answers
5 views

Add an option to Appreance->Menus->pages

If I go to wp-admin and add a page, that page appears under Appearance->Menus->pages. How can I add the same link under pages without adding a page? By PHP ofcourse. I know how to add an item to the ...
0
votes
0answers
25 views

How to apply individual menu item's “CSS Classes” to <a>, not <li>?

WordPress' Menu constructor allows you to apply custom "CSS Classes" to menu items... However, those classes are applied to the list item which wraps anchors, and not to anchors themselves... <...
2
votes
1answer
52 views

Walker_Nav_Menu: Items not nested correctly

I want to add "anchor" tag adjacent to every "list item" that has children. this is my Walker_Nav_Menu class: class Menu_Walker extends Walker_Nav_Menu { function start_el( &$output, $item, $...
0
votes
1answer
41 views

How to add close button to dropdown menu that also reverts to menu button on another click

I am creating a custom dropdown menu for my WordPress blog header. I did everything correctly but could not add close button that opens on first click and revert to default on another click. I mean ...
0
votes
0answers
8 views

menu selection of “blog” or “home” doesn't show post

I am using the Ocean wp theme When I go to my site, the blog post is there, and everything is fine. Then if any menu items are selected (like "contact"), and you try to return to the post by ...
0
votes
0answers
5 views

Statically populate menu with childs

My problem is very simple. I want to add all pages and subpages of a given parent page inside a menu. The problem is that the few plugins I found for this purpose, JC's Submenu or Gecka Submenu, do it ...
0
votes
0answers
14 views

Best plugin to create a navigation menu from a product custom field

I have a woocommerce site and I use WP All Import which creates some custom fields during the import process. I'd like to create a navigation menu from one of these custom fields but can't find a ...
0
votes
0answers
16 views

wp-bootstrap-nav walker collapse is not working on ipad

Bootstrap navbar collapse is not working. The issue is that it shows a collapsing menu but on click, it is not collapsed. I have provided my full code so that it can help you to suggest or help me to ...
1
vote
1answer
24 views

How to get the post name (slug) from the item ID when traversing the navbar?

I'm working on a filter for nav menu items, such as add_filter('wp_get_nav_menu_items','nav_items', 11, 3); function nav_items($items, $menu, $args) { foreach ($items as $item) { $slug_1 =...