Questions tagged [menus]

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

How to truncate menu label in wordpress?

I want to truncate the menu label to 10 characters, and if the header label is more then it will show 10 characters followed by ... For example: Menu Title: ABCDEFGHIJKLMN It should display the label ...
-1
votes
1answer
13 views

How to load css file in my menu in wordpress

Anyone know how to load css file in my menu in wordpress. use this but it didn't work function wmt_theme_style() { wp_enqueue_style( 'bootstrap-styles', get_template_directory_uri() . '/css/...
0
votes
0answers
8 views

add_submenu_page - cannot change slug

I have a problem in my plugin adding a submenu. It works as an administrator user, but if I run as a user who is not admin, it will not work. I am adding my menus as below. add_action( 'admin_menu'...
0
votes
0answers
8 views

Header Button Chance Polylang Elementor

Currently, I am making a Bilingual website, and I made a button on the header as well, and I want to make the button bilingual as well, but I don't know how could I change its language because it is ...
0
votes
0answers
10 views

Under My Sites Menu, I can find only one of my Sites, and it is duplicated

I have WP Multisite. I have only two Sites. The main one, and a second Site as a subdomain ( EN.mydomain.com ). The problem is, if I am in my main site, I can find both Sites under MY SITES menu. But ...
0
votes
0answers
19 views

Adding menu title to custum URL

I want to customize my url rewriting this way : urlhome/MenuTitle/PageTitle. Is there a way to do it?
0
votes
0answers
13 views

Sub Menu Do Not Appear in Homepage

i have a problem here, i try to make 3 level navigation menu, but only 2 of 3 navigation menu are showing. This is my homepage When i try to inspect element from browser, i saw the sub menu. I try ...
0
votes
0answers
23 views

Need to remove the admin menu item from a be theme in wordpress

I need to remove the few admin menus of BeTheme from admin wordpress menu. Although this code works (when added to functions.php) for usual wordpress admin menus add_action( 'admin_menu', '...
0
votes
0answers
21 views

Go back to the exact post page number

I use pagination in my index.php and I have many posts per page. Every post have a button to go back to home. The problem is that when I visit a post in a page 5 for example, the button always send me ...
0
votes
0answers
14 views

How to filter menu of categories on attribute archive pages

The following PHP displays menu of WooCommerce product categories: <?php $orderby = 'name'; $order = 'asc'; $hide_empty = true ; $cat_args = array( 'orderby' => $orderby, 'order' ...
0
votes
1answer
27 views

How to add class to specific navbar item when post parent category is in specific category

I have website with pages which are named the same as categories. For example I have page called Cities and also I have category called Cities. I want to add class to navbar item when user is reading ...
0
votes
1answer
28 views

How to add CSS class to <li> and <a> and id in a nav menu with code?

I have registered nav menu. here is the code <?php wp_nav_menu( array ( 'theme_location' => 'top-menu', ...
0
votes
0answers
9 views

highlighting navigation issue (custom post types & pages)

I have an issue which i cant wrap my head around, as im lacking knowledge. Wordpress is in this instances not generating any specific class that i could address and this is my problem, NOT the CSS. I ...
0
votes
0answers
12 views

Mega Menu Walker Add Description

I'm using a custom walker to display a mega menu. I've enabled Descriptions in the menu admin but I can't get it to display in my menu. My description is on the parent item but I need to display it on ...
0
votes
1answer
10 views

Parent Menu Item Requires Two Clicks for Mobile Device

I don't know what's what wrong with my parent menu items. I have two that aren't working on the first click on mobile devices (I've been testing this on my android phone). To make it look mobile ...
0
votes
0answers
10 views

Why my newly added menu items(page)in word press website is not showing same hover effects as menu from other pages [closed]

The hover color in main page is blue but when i click the newly added research page the color of the menu changes to red?
0
votes
0answers
12 views

Update JavaScript by refreshing menu in wordpress customizer

In Wordpress customizer adding or removing a new menu item refreshes that area, removing decorative details that I add with JavaScript in the preview. As seen in the image: Put this code so that ...
0
votes
1answer
18 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
0answers
7 views

How to add html attributes to wordpress menu <li> that have sublists

I want to code bootstrap collapsing navbar for wordpress menu. I found that how can i add html attributes in this link but i don't know how to add html attributes just to <li> that have submenu ...
0
votes
1answer
16 views

How can I creat custom menu with bootstrap

I'm trying to create bootstrap collapsing navbar for WordPress template. I have to add some HTML properties such as data-toggle. After researching, I found that must customize the Walker class but ...
0
votes
1answer
36 views

is MariaDB error related to Automatically add new top-level pages

I ran some checks on RAM on my machine and discovered this error "Error: (06/14/2020 12:45:54 PM) (Source: MariaDB) (User: ) Description: mysqld.exe: Table '.\test\wp_usermeta' is marked as ...
0
votes
0answers
41 views

child theme automatically adds new page to top menu instead of only custom menu

In my child theme I have top navigation and custom navigation (archive menu). When I add new page to archive menu, same page gets added to top nav. In the admin top nav doesn't show new page though,...
0
votes
0answers
23 views

Change cart icon - Neve theme + Woocomerce [closed]

How can I change the icon of the shopping cart on my website. I have downloaded the WP SVG Icons which allows me to add short-code for the desired icon I want. I then in the header add custom HTML and ...
0
votes
0answers
8 views

How to apply a class to nested sub-items of a menu?

I am trying to replicate this drop-down menu in a Wordpress theme: But I've spent my whole week to only get this result: (The sections items are properly handled, but their sub-items are a mess! "...
0
votes
0answers
14 views

Combine a category and a custom taxonomy in one menu item

I have created a custom taxonomy for my posts named 'type-of-article'. I also use the standard taxonomy 'category' How can I create a navigation menu item that shows the posts belonging to an ...
0
votes
0answers
4 views

Add text before anchor link for product menu item type

I'm working on a nav menu that includes WooCommerce Products for part of the menu items. I am looking to add the WooCommerce thumbnails to the menu items that are products, but I can't seem to find ...
0
votes
0answers
11 views

By default header menu is taking footer menu as Id and displaying footer menu in header too

Here is my functions.php code <?php register_nav_menus( array( 'primary' => __( 'Primary Menu', 'akeo-tech' ), 'footer' => __('Footer Menu', 'akeo-tech'), 'mobile_header' => __('mobile-...
0
votes
1answer
38 views

Search if menu item has child in wp_get_nav_menu_items hook

I am conditionally showing menu items. All is fine but want to remove parent item if returning no child items. For example if I have a parent menu (it will always be a custom link with #) called ...
0
votes
1answer
55 views

Secondary Menu and Logged In Users

I'm using the below code to display two different menus in my storefront based child theme based on a users logged in status. But When I have a secondary menu (links by the search bar) it is replaced ...
1
vote
0answers
37 views

How to extend nav-menu-item-control data in Appearance > Customize?

I have one question as for Nav Menu Items custom fields in the Appearance > Customizer screen. Since 5.4. there are 2 new hooks: wp_nav_menu_item_custom_fields - it works for Appearance > Menus ...
0
votes
1answer
25 views

Change hover to onclick on menu

I've got a local website on WP using DIVI where a header menu got some "menu-item-has-children". In way to view these sub-menu, I just have to hover on it and when mouseout the sub-menu disappear. ...
0
votes
0answers
8 views

How to show item automatic from in horizontal mobile menu

<div class="hr-nav-1"> <nav class="nav-container"> <a href="#!" class="nav-item">Latest</a> <a href="#!" class="nav-item">Trending</a> <a href="#!" ...
1
vote
1answer
19 views

How to dynamically populate a dropdown

I am tasked with creating a subnav in the body of our custom-built pages. The nav's last item is supposed to be a clickable dropdown (a "more" button) that can dynamically populate if extra pages are ...
0
votes
0answers
11 views

Change menu image on hover

I have the following code to display my menu. What I would like to do is have the image change when the menu item is hovered over. <nav class="site-nav"> <?php $imgsrc = "<img ...
0
votes
1answer
25 views

Wordpress menu walker - help to add custom class for each submenu

I am trying to apply to my already existing menu a walker in order to add custom classes to every sub menu anchor tag. Here is my menu: wp_nav_menu(array( 'theme_location' =&...
0
votes
1answer
17 views

How to make dynamic dropdown in navbar menu?

My navbar is currently using menu structure like this -- Home -- Our Company -- Our Products |-- Category 1 |-- Category 2 |-- Category 3 -- News -- Contact I set them all from Apperance > Menus. ...
0
votes
1answer
40 views

Putting footer links into different columns

Essentially I would like to drag each footer menu item to the column of my choice. I've created 3 widgets for each footer column, but I can't figure out how to separate the navigation menu items on ...
0
votes
0answers
6 views

Custom mega menu with Woocommerce product category

I have a category named "Grocery" in menu. In Mega menu I would like to display its 2nd and 3rd level categories. By using the following code I was able to display its 2nd level categories but kindly ...
0
votes
1answer
22 views

Hide default menu items in wordpress apearance > menus

In a wordpress theme, when i get to appearance > menus i can see some default options to add to my menu (pages, posts, custom-links, etc) and custom post-types. I only need Custom Links to be shown. ...
0
votes
0answers
11 views

Use Custom Taxonomies as menu and sidebar

Nice to come back coding. I'm working on my new projet: http://www.abraselemcasa.com.br/ There, I have custom posts ans custom taxonomies as you can see below: The fist one is no hierarquical ...
0
votes
1answer
40 views

child theme font awesome icons not working

I created custom social media icons menu as recommended here, using custom links and optional CSS class. my child theme footer.php currently has <?php if ( has_nav_menu( 'social' ) ) : ?> ...
0
votes
0answers
7 views

Sidebar menu similar to developer.wordpress.org

I like the menu on developer.wordpress.org and would like to use it for my documentation section on my website. Does anyone know what theme or plugin wordpress.org uses for this menu or how to ...
0
votes
1answer
22 views

Wordpress site hamburger menu toggle not working

When I shrink down the browser to test for mobile responsiveness, the hamburger menu does not open, even after I clicked on it. I have tried everything from troubleshooting my plugins to searching all ...
0
votes
0answers
12 views

Centering Word Press Menu in Ocean WP

No matter what I do I can't seem to find a way to simply center the top menu in my WordPress site built through Ocean WP. I chose to have it fill the full width of the screen but I can't seem to ...
0
votes
0answers
14 views

Center logo with navbar and cart option

How can i design Center logo with nav menu.In Mobile view i need Search icon and Cart icon.and Static navbar needed. Some examples https://biona.co.uk/ http://palkova.in I tried different themes but ...
0
votes
0answers
20 views

Addfilter menu link attribute

I explain you my problem, I have created this filter to add a custum attribute for menu item link : function mytheme_add_menu_link_class($attrs,$items,$args) { $attrs['data-linkid'] = $items->ID; ...
0
votes
0answers
14 views

How to add a new field to the WordPress menu editing section with wp_nav_menu_item_custom_fields

How do I add a new field to the WordPress menu editing section? For example, The Ability to upload images. Of course without plugins.
0
votes
0answers
7 views

adding page menu items after demo import

I am trying to build a importer which once import everything including pages will assign the some pages to the menus I have added during import. I have so far maanged to import pages, post , images ...
0
votes
1answer
16 views

How to put 2 php codes in functions.php without site crashing

I can use either the php script for a menu <!-- menu --> <?php function wpb_custom_new_menu() { register_nav_menu('my-custom-menu',__( 'My Custom Menu' )); } add_action( 'init', '...
0
votes
0answers
19 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>&...

1
2 3 4 5
61