All Questions
Tagged with menus theme-development
200 questions
0
votes
0
answers
21
views
How can I keep a WordPress dropdown menu open when navigating to a child page?
I'm using WordPress with the Astra theme (free version), along with Elementor Header & Footer Builder (free version) and the WP Mobile Menu (free version). I've set up a dropdown menu, but it ...
0
votes
0
answers
41
views
wp_nav_menu_items callback not triggered
I display the menu so:
<?php wp_nav_menu(array('theme_location' => 'primary'));?>
I am trying to edit it, in my functions.php file I have:
add_filter('wp_nav_menu_items', '...
1
vote
1
answer
30
views
What is considered good practice for registering menu locations?
I decided to try my hand at creating my own WP theme from scratch. I've made a header, a navbar, and a footer so far. I've also registered a couple menus, so my navbar will be populated automatically ...
0
votes
2
answers
20
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 ...
1
vote
0
answers
24
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
0
answers
24
views
Why is wp_nav_menu() not removing the container around the nav <ul>?
I am trying to remove the <div> that wraps the <ul>, but when I set 'container' to false or '' the <div> still shows up. Why is it not being removed?
Example with false:
<nav id=&...
0
votes
1
answer
69
views
How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?
When creating a menu, and after selecting a page as front page and another page as posts page..it appears next to the page in menu screen. For example, "Front Page" appears next to home page,...
1
vote
1
answer
1k
views
Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
I would like to Create A Wordpress header with {the_custom_logo();} custom logo in between the menu splitting the menu into two equal parts so that the logo is always aligned to the center of the ...
0
votes
1
answer
31
views
how to create/register menu items that can be added to menus later
I noticed some popular plugins (i.e woocommerce as in the image below) have their own "menu items" that can be added to any menu.
how can I create my own ?
I checked the entire theme ...
0
votes
1
answer
316
views
Why nav_menu_css_class doesn't work with apply_filters?
I was trying to add css class to nav items.
The documented function call in WordPress docs was
apply_filters( 'nav_menu_css_class', string[] $classes, WP_Post $item, stdClass $args, int $depth )
But ...
0
votes
0
answers
24
views
Best way to give user the option to make a menu, mega menu?
i am developing a WordPress theme for themeforest and i was wondering whats the appropriate way to give the option to user to make a menu, mega menu. currently my way is that user has to go to ...
1
vote
0
answers
484
views
How to create left and right menu with logo center in a custom theme?
I recently developed a new custom theme in wordpress. I want the following menu structure:
Left menu LOGO Right menu
For example:
Home About LOGO HERE Blog Contact
I created the following code:
<...
0
votes
0
answers
41
views
Programatically Created Menu not Editable in Dashboard
When my custom theme gets activated, it programatically creates some default pages with custom templates, a nav menu, and several menu items. This saves me a lot of time not having to do those same ...
0
votes
1
answer
297
views
Functions php shortcode for displaying main menu with no child items
I have the following simple functions.php snippet to generate a shortcode which will add a menu to a Wordpress site. I would like to do two new things so that I can use this in a footer. I'm lazy and ...
0
votes
0
answers
46
views
Building a custom menu or use a plugin?
I am currently building my first ever wordpress theme, making good progress so far.
The very last and possibly hardest part is the menu the client is thinking about.
What it should look like:
Menu 1 ...
0
votes
0
answers
695
views
3 Level Menu Navigation (3rd Level not displaying)
I am using wp_nav_menu on my wordpress theme but I can seem to figure out how to display the last level on my menu navigation. I would like the last level to display on hover of the parent item.
Here ...
0
votes
1
answer
69
views
Nav menus all outputting the same links
I have registered the following menus in my functions.php
// register menus
function register_menus() {
register_nav_menus(
array(
'footer-01' => 'Footer 01',
'...
0
votes
0
answers
131
views
Use <span> instead of <li> for wp_nav_menu()
I'm porting over a theme I made to Wordpress. For my menus, I used spans and not a list. I was trying to make wp_nav_menu output something like this: <div ...><span><a>...</a>&...
-2
votes
1
answer
355
views
Invalid Menu Items
I registered a taxonomy named districts, but when I add districts to nav menus, the nav menu items are invalid! Here is the code that registers the taxonomy:
function masallah() {
// Add new ...
0
votes
0
answers
459
views
Theme: dropdown hover menu not showing up in IE/Edge
I'm using the theme Illdy, and the hoverable dropdown menus on the top navbar are not dropping down in IE or Edge. Firefox and Chrome appear to work.
I've tried adding a variety of these to the ...
1
vote
1
answer
59
views
Part of Menu Item Hidden on Header Menu
My business site is built on WordPress and I am using the "Shifters Lite" WP theme right now.
My issue is:
One of my primary menu item (designed as per my web-pages) is getting hidden on the Header ...
0
votes
1
answer
174
views
Why are some of my menu items not displaying on my menu?
I'm a backend dev learning WordPress for the first time. I'm trying to create a menu in the admin GUI, but the menu isn't displaying all of the items that it should.
As you can see, the menu is ...
0
votes
1
answer
108
views
cpt not display inside nav menu
I have created a cpt to realize a dedicated section of a website and I want to show it inside the navigation menù with the various post created under the cpt linked as children. I've noticed that the ...
0
votes
1
answer
1k
views
How to Create custom xml file for demo content for custom theme?
I am created custom Wordpress theme.
Now i need to create functionality for demo content import such as Pages, Posts, Widgets, media and menu.
My question for demo content is possible for above ...
0
votes
0
answers
369
views
Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
I looked (surfed) around a lot to get idea of how can I add custom field/drop-down under "Menu Settings" in WordPress Admin.
I want a select tag with options from which I can get value based on the ...
1
vote
0
answers
50
views
Custom Nav Walker Trouble
I got a snippet for a custom nav walker online and it works fine for the main menu items. I can't figure out how to get it to work for the sub-menu items.
This is what i'm trying to achieve:
<ul ...
2
votes
1
answer
2k
views
Custom Nav Walker Displaying Values in Sub Menu
I'm trying to display Submenu links within a Custom Tailwindcss / Vue component that I added within the Nav Walker.
Menu Issues
header.php
<nav class="flex items-center justify-between flex-...
1
vote
1
answer
760
views
Get Current Menu Location inside Nav_Walker
How can I retrieve the current menu location (as registered with register_nav_menus) from inside a nav-walker class?
eg:
<?php
class Special_Nav_Walker extends Walker_Nav_Menu {
// How can ...
-1
votes
1
answer
20
views
Global Navigation menu in diiferrent wordpress setups
I have 2 different wordpress sites but I have deployed it like
www.xyz.com and www.xyz.com/news Now I am trying to get main menu from www.xyz.com and it should work with www.xyz.com/news
main purpose ...
0
votes
1
answer
835
views
wp_nav_menu not working correctly in my underscores theme
I'm using a theme based on underscores, and I have registered my menus in the following way.
function register_my_menu() {
register_nav_menus( array(
'primary' => esc_html__( 'Primary' ...
0
votes
0
answers
62
views
Pages not displaying as sections on static page
I'm currently working on the Twenty-Nineteen theme. I'm trying to make each "page" display as a section on my homepage. This has worked in previous themes (i.e. Twenty Seventeen), however I'm clearly ...
0
votes
1
answer
156
views
How can I show a custom WordPress menu anywhere I want on my website?
I went into Appearances > Menus and created my own menu called "default menu." Then I tried to include it in my WordPress theme, but was unsuccessful. I am trying to include it just before the footer.
...
0
votes
1
answer
80
views
Theme development - Automatically menu creation
I've been working for a couple of days with automatic creation of menu upon theme activation in wordpress. I've achieved the creation of menu and it's working as expected, except i want to add sub ...
0
votes
1
answer
34
views
Replace Home with image link inside custom header menu
What I want to achieve is a header menu like this:
Right now, I have this:
I am not far off. To get to where I am currently at, I followed these instructions and added some custom CSS. So I added ...
1
vote
1
answer
911
views
Wordpress navbar with logo in middle [closed]
I was searching for something that could help me with query but could not find a understandable solution.
What I am trying to do is show the site logo in the center of menu. I have checked the split ...
0
votes
0
answers
50
views
Show all menu levels except top level. How to exclude top level of a menu?
I have a menu that looks like this:
Women and Men har the top level menu items while the lower nagivation menu items are the children.
The menu structure looks like this:
Women
New styles
...
0
votes
1
answer
379
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
1
answer
222
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
0
answers
440
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
1
answer
2k
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 ...
0
votes
1
answer
106
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 ...
2
votes
1
answer
3k
views
Wordpress nav_menu_css_class theme filter is not being called
I'm having problems getting a filter to work. I'm trying to add a class to each <li> element of a menu. This is on my theme's functions.php file:
/**
* Adds custom classes to the items in the ...
3
votes
2
answers
4k
views
Return only top-level navigation items from a menu using wp_get_nav_menu_items
I have the following function in my project:
function cr_get_menu_items($menu_location)
{
$locations = get_nav_menu_locations();
$menu = get_term($locations[$menu_location], 'nav_menu');
...
1
vote
1
answer
3k
views
how to wrap <a> tag in <span> tag html to wordpress menu conversion
I am converting a non-bootstrap menu to wordpress. It has no drop downs so I don't think I need to use a walker class. When I inspect it in Google Chrome, the ul tag class is correct and the li but, ...
1
vote
1
answer
2k
views
How to set the currently active page in the menu including parents
I have the following problem:
There is a custom post type. There are several pages each listing some of the posts based on some post criteria (custom WP_Query).
When I click on a link to open the ...
1
vote
2
answers
57
views
2 differen't menus and it's using same items in both
I'm building a theme, in which, I have 2 menus:
Footer menu (footer-menu)
Main menu (main-menu)
However, when I called the main one in the header.php file it uses the same links added in the footer ...
0
votes
0
answers
48
views
Menu names not getting translated
I've got the following code in a theme to register two menus:
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'text-domain' ),
'secondary' => esc_html__( 'Secondary', 'text-...
0
votes
2
answers
354
views
How can I add different menus (different style menu) on each page?
So I want to have a normal menu on the home page but on the other pages, I want "hamburger" menus! I've searched for a plugin but all of the menu plugins were more like to edit the mobile menu or had ...
0
votes
1
answer
205
views
Nav menus Fast previewing not working with wp_get_nav_menu_items!
I have a problem and I know why but I can't find a solution or how I can fix it!
The problem is when using the customizer preview in menus the live preview editing it's not working and that's ...
1
vote
1
answer
1k
views
My Admin bar covers my sticky navbar [closed]
I'm trying to develop a theme with a sticky navbar but the problem is the admin bar of wordpress covers my sticky navbar that is made using bootstrap.
help please.
this is my navbar code:
<!-- ...