Questions tagged [wp-nav-menu-item]
59 questions
0
votes
1 answer
How to change a ul element to a div on the wp_nav_menu|
change the ul to a div
I need to change the ul tag to become a div.
I have changed the class from sub-menu to nav__list-sub-alt nav__dropdown js-nav-next using the code below
echo str_replace('sub-menu', 'nav__list-sub-alt nav__dropdown…

Dami Sadiq
- 1
- 1
0
votes
1 answer
0
votes
1 answer
Wordpress , local anchor instead of full link with wp_nav_menu
I'm trying to change the href to a local anchor. My idea was to use preg_replace to strip the home_url();
Instead of....
Menu Item
...I'd like to create
Menu Item
My code so…

user915308
- 161
- 1
- 2
- 13
0
votes
1 answer
Wordpress Display ACF only in first depth nav
I write function for display acf in menu.
I need to display only in depth [0].
All work. But i still to se terrible notice:
Notice: Undefined index: nav_menu_item_depth in
here is my code:
add_filter('acf/location/rule_types',…
0
votes
1 answer
WordPress Footer menu showing in the Top menu place
For some reason when I created a footer menu and the location as footer, it also shows up in the top menu location.
I have checked that both menus are set to their correct locations in the Admin -> Menu area and also checked my child theme code to…

Sambuxc
- 425
- 2
- 11
- 26
0
votes
1 answer
Bootstrap WordPress Menu: Add Custom CSS Class
Good evening, I need to convert the following static menu into a menu for WordPress. Below is the HTML code:
0
votes
1 answer
Wordpress how to remove auto generated in the navigation menu
I uploaded the pages including my header.php to wordpress and my header have auto generated   in it together with #text.
I tried adding this code but nothing happens.
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt',…

Kirby Tan
- 103
- 11
0
votes
1 answer
How can I dynamically add a new menu item to the beginning of a specific WordPress menu?
I have 4 menus registered within my WordPress theme.
register_nav_menus( array(
'menu-1' => esc_html__( 'Primary', 'honeycomb' ),
'menu-2' => esc_html__( 'Mobile Cat Products', 'honeycomb' ),
'menu-3' => esc_html__( 'Top Bar',…

Chad Warren
- 107
- 2
- 17
0
votes
1 answer
How to add php code inside link_before inside wp_nav_menu()?
I want to add this line
inside
wp_nav_menu( array $args = array( 'link_before' => 'ADD_CODE_HERE' ));
but it doesn't work because link_before is for text.
Is there any way to add this code?

mountainhuman9910
- 17
- 4
0
votes
1 answer
How to add item in nav menu in wordpress dashboard?
How can I add a button or link to nav menu item for area that I refer to it in image attached below in wordpress dashboard?
What hook or function can I use?

Ali Falahati
- 1
- 1
0
votes
1 answer
how can i make div or id visible only to logged in wordpress author
The menu item contains data that should only be visible to the wordpress author of the data.
Is there any way to…

Christoph Messing
- 13
- 2
0
votes
0 answers
Add HTML to beginning and end of parts of a string if class is found in li elements
So, I am trying to change the DOM structure of a wordpress menu based on if the class submenu-item exists on an li. What I would like to do is change it so that comes after the…
- is before the group of li's and

Solomon Closson
- 6,111
- 14
- 73
- 115
0
votes
1 answer
Make a menu item visible for logged out users on wordpress
I'm facing a problem kinda weird.
I've edited and set the wp-login.php page to my brand and set the redirections such as:
costumer > my account (after login)
admin/editor > admin panel (after login)
and so on.
But my problem lies in the menu…
0
votes
1 answer
Wordpress - Showing custom menu links while showing child pages
I have this loop that simply shows all child pages of the current page:
$post->ID,
'post_type' => 'page',
'sort_order' => 'ASC'
);
$pages = get_pages($args); ?>

Shaun Taylor
- 932
- 2
- 16
- 43