Unanswered Questions
1,047 questions with no upvoted or accepted answers
1
vote
0
answers
114
views
WP Menu Walker - How to know total depth from inside the start_lvl() method
The start_lvl() method allows to know the current $depth parameter. But, I need to output different results at level 1 if the menu has x or y total levels.
I did a print_r() of the $args array, but ...
1
vote
0
answers
34
views
Filtering Only a Specific Menu using the “add_additional_class_in_li”?
Thanks to some help on here, I've managed to add bootstrap classes in main navigation li tag by adding this to my theme's functions.php
// adding css to li tags for menu styling
function ...
1
vote
0
answers
198
views
How do I add recent posts to the menu?
How to add recents posts to the menu? Entries with pictures. "Menu-item-object-custom" items in a div container?
What I have now is:
header.php
wp_nav_menu(
array(
'...
1
vote
0
answers
840
views
Displaying primary nav menu two ways
Trying to modify the Twenty Twenty-One main menu. Given a main nav menu such as:
Name of organization (links to home page)
About
Etc...
For default behavior (on most pages other than home page), we ...
1
vote
1
answer
490
views
How to add ID attribute to each submenu?
I would like to add an ID attribute to each list <ul> submenu. I am using the Walker class extension. I have managed to modify some elements, but I am left to solve this one problem. I need the ...
1
vote
0
answers
32
views
Easiest way to add dropdown to a page
I am trying to add a dropdown menu to my page (not menu or widget section) and once the user selects an item from that menu, it redirects to a specific page. I have tried using the block editor, but ...
1
vote
0
answers
54
views
Wordpress warning: "private_to_published" Deprecated when creating nav with wp_update_nav_menu_item()
For reasons specific to how my local development environment generates Wordpress menu items, I am trying to programmatically create a menu using wp_create_nav_menu() and wp_update_nav_menu_item().
My ...
1
vote
0
answers
103
views
Add css class to dropdown
This is a dropdown with two items. I want to visually give these two items a css style.
Is this possible? This is the code I used:
(function($) {
"use strict";
tinymce....
1
vote
0
answers
282
views
Automatically adding new post categories to menu
Disclaimer: I am not 100% fluent in php. If I am doing something wrong in asking this here, please let me know. Many thanks!
A site that I am working on is set up with several custom post types: City, ...
1
vote
0
answers
113
views
Change search results order for Admin -> Appearance -> Menus -> Pages -> View all
I have over 200+ pages (about 100 for each of my two languages).
How I can change the order of results? I need the same as on the page with Page list.
On the Page list e.g. you have a parent page and ...
1
vote
0
answers
25
views
nav_menu not displaying custom menu
Default menus will appear on all pages with no issues. However, when I configure a custom menu, it is displayed on all pages, other than the home page//main blog page. The menu disappears, the tags ...
1
vote
3
answers
3k
views
Why is my Bootstrap 5 navbar not displaying the drop down menu on smaller screens?
I am trying to develop a bootstrap 5 theme for the latest WordPress. I am using Navwalker from here: https://github.com/wp-bootstrap/wp-bootstrap-navwalker. My bootstrap Navbar does not dropdown on ...
1
vote
0
answers
415
views
Add data attribute to each li in menu
I have a menu listing all of my products categories in Woocommerce. I need to add an attribute data-relation to each <li> tag and the value for each one would be the ID of the category.
I ...
1
vote
1
answer
32
views
display menus on all page except one?
I'm not very good at this, so please bear with me. I have a Wordpress site with sections for different cites, and the different cities each have their own nav menu which shows for all of the pages in ...
1
vote
1
answer
11
views
How do you link to a place in another page without any styling issues?
I have a 'Meet Our Team' section on my home page and I want to be able to click a menu button 'Meet Our Team' and be directed there, even if I click it from another page.
My problem is that if I use #...