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.

learn more… | top users | synonyms (6)

0
votes
1answer
208 views

Counting top level items in a custom menu walker

I am creating a split menu (half the items on the left, logo in the middle, remaining items on the right). I don't really understand Walkers all that well, but I found this code snippet. This was ...
1
vote
2answers
64 views

Two different menus for two different locations?

I'm trying to change the menu in a primary and a secondary menu depending on the page which is visited. My primary menu is in the top of the page, and it looks like this: Index | About | Contact ...
5
votes
5answers
11k views

How do I remove UL on wp_nav_menu?

I search on this site and found many answers for this question. Most of them is not working on my theme. Here is a one solution I found and it's working according to my need. function ...
0
votes
0answers
41 views

Move WooCommerce menus to submenu settings

i'm searching a function that will move my woocommerce dashbord menu items (Products, WooCommerce) to wordpres submenu: settings I try to remove menus and add them again using: add_action( ...
0
votes
0answers
18 views

Custom menu problem

I have following menu coded under header.php and i want to add an page under a category menu as an example instead of 36 (category id) i want to display the page id 8197 P.S. i tried to remove the ...
2
votes
1answer
132 views

Creating new menu item

I'm looking for a way to create a new item that can be added to a menu. Here are the details of my problem: I use WPML. WPML have that nice feature that you can add the switcher to a menu, ...
0
votes
0answers
22 views

Function for moving a sub menu under a different top level menu?

I have a snippet that will allow me to make submenus become top level menus, but can you help with a snippet that will allow to move a submenu to be the submenu of a different top level menu? For ...
17
votes
5answers
18k views

Add 'has_children' class to parent li when modifying Walker_Nav_Menu

I'm writing a customised walker class for wp_nav_menu and want to be able to specify if an li contains a submenu. So I want my markup to be: <li class="has_children [other-wordpress-classes]"> ...
0
votes
0answers
15 views

Is using categories for site structure a bad solution

I've been thinking about a current site structure implementation that relies on categories to build out the menu structure and the category template to render site content. As categories can change ...
3
votes
3answers
14k views

How to add a data attribute to a WordPress menu item

I'm Twitter Bootstrap and need to add data-toggle="modal" attribute to the a tag of menu link. Upon searching most all results reference doing a walking for Twitter Bootstrap dropdown menus however ...
2
votes
1answer
9k views

Add class to active element and its parent in nav menu

I am using the following code in order to add a class name "active" to the current menu item: add_filter('nav_menu_css_class', 'add_active_class', 10, 2 ); function add_active_class($classes, $item) ...
0
votes
1answer
19 views

Mark a page of a queried menu as active

Im trying to mark as active a page of a queried menu --> (I found the answer) function render_main_menu(){ $args = array( 'post_type' => 'a_cpt', 'tax_query' => array( ...
0
votes
1answer
575 views

Admin Menu Hack (Left side in Dashboard)

How can I add a Title to my Admin Menu on the left side of the dashboard? Not a link, but just a title? I want do this in my functions and not use a plugin. Also which template file handles this menu? ...
1
vote
1answer
75 views

Check if a menu is empty?

I have menus set corresponding to a custom field on a page. Ie I have menu1, menu2, and menu3 on three pages under custom field => MenuName. Under functions.php I have: /* Add Menu Locations */ ...
1
vote
1answer
2k views

Change an li class name in a wordpress custom menu walker

I'm building a nav that has a class applied to the main LI's and the nested LI's. Example: <ul> <li class="className">Test</li> <li class="className">Test <ul> ...
0
votes
0answers
7 views

How do subpages work in Wordpress and are they affected by custom post types vs pages?

I've got a landing page that covers an overview of a company's offerings. There are then subpages that detail different types of offerings (this may be something that the user can add more of). I ...
0
votes
1answer
35 views

How to add a toggle on the left side of my page?

How to add a toggle on the left side of my page and the content on the right side of my wordpress page. The toggle should behave like a menu on the left side(the arrangement)and each heading would ...
0
votes
0answers
76 views

Custom walker menu , add class link before

I'm trying to implement a responsive jQuery navigation but I need to extend the default output of the WP menu. I believe I need to use a custom walker but honestly, I don't know how to get it to work ...
0
votes
0answers
16 views

Add menu section and items to the Appearance > Menus page

I am writing a plugin that creates some virtual pages according to How do you create a "virtual" page in WordPress. I want to be able to add these virtual pages as options in the Appearance ...
0
votes
0answers
29 views

Custom nav menu current item custom link problem

Because I want to add <span class="dashicons [class]"></span> inside each link of my menu I needed to create a custom made nav menu. I did this by the code below which works great, but ...
0
votes
0answers
28 views

working with wordpress theme

I am trying to create a wordpress theme, actually I am very new to wrodpress theme and plugin and currently learning wordpress theme, so I have a html design with me and I am trying to convert it to ...
0
votes
1answer
36 views

is_page() not working with archives?

I am creating a dynamic menu and in my foreach loop I am running a is_page using the page title: <li class="<?= (is_page($tlp->post_title) ? 'active' : '');?>"> </li> This ...
0
votes
1answer
84 views

Adding archive years to my menu

I'm Wordpress newbie and despite of reading many articles, I'm able to put archive years to my main menu. Menu contains pages and I need to add an archive. My current menu: - Home (page) - About ...
0
votes
1answer
31 views

Menu not appearing in custom theme

I made a custom theme, but the menu is not showing in appearance section. I created a separate function file named function.php and the code is: add_theme_support( 'menus' ); function ...
1
vote
1answer
127 views

Replace menu permalink/hyperlink with only menu name/slug

I don't know if i am asking this correctly, but i will try. I am doing this for history pushstate purpose. Code to get menu wihout ul and li: $topmenu= array( 'container' => false, ...
0
votes
1answer
35 views

wp_nav_menu doesn't work in a duplicate server

I duplicated my Wordpress installation to move to another server. Everything works find except one single file. I created a header-shop.php file to call a certain menu on my shop page. In the first ...
0
votes
1answer
42 views

Any simple way to show 10 previous pages by id to current page in links as a menu

I've been reviewing any plugin that may help in this but I got nothing. For a web using pages instead of posts, I may need to show in each page a menu consisting of 20 previous pages, or maybe 10 ...
0
votes
2answers
1k views

Admin top level menu, pointing to an external url

I want to create a entirely new top level menu in the admin menu section, and have that be an external link, is this even possible with the current system? The solution that t31os provides in this ...
0
votes
1answer
38 views

how to change single post link

I have made a website for a client which involves products tab in navigation. Products are the posts that being posted in "posts". I have a front-page.php which is static. posts are displayed in ...
0
votes
0answers
54 views

Way to add archives as a menu item?

Is it possible to add an Archives dropdown -- like the Archives widget -- as a menu item in Menus?
0
votes
0answers
27 views

Simple modification for menu structure

I'm trying to make a menu for my website, but I want it to be easily modified through original WP menu(dashboard > appearance > menus). I want to add some small thing to the structure of my menu, ...
0
votes
0answers
16 views

Add parent link to its submenu

How to add parent link to its sub menu in navigation bar? I mean any hook, filter or custom navigation Walking? You may know, this problem is coined from the feature of mobile menu, I cannot go to ...
0
votes
1answer
45 views

wp_nav_menu_items for one menu

I tested this tutorial. It works great. The problem is that in the tutorial there is one menu while I have 2 menus. Let me know how I can customize this function for the feature only applies to ...
0
votes
1answer
12 views

Can't change link for navigation item

I'm customzing a wordpress theme so problem is that i've to change a link. its in arabic for example instead of this <a href='somelink.com'> i want to make it like this but problem is that ...
0
votes
1answer
37 views

Parsing Menu Items and Blog Posts

Question 1 I'd like to be able to show or hide certain pages in the main navigation menu based on whether or not they have certain prefixes in their title. This is mostly for the purpose of language ...
0
votes
0answers
19 views

Creating a geo-region Homepage and having Cookie Options

We have a website and we would like to have a feature similar to the HuffPost website. The website shows if the user went to switch to that regional edition and keep the cookie that when they go to ...
0
votes
1answer
55 views

wp_nav_menu not selecting teh correct menu

I'm having a weird issue. I have 2 menus, and registered them in functions.php, like this: add_theme_support( 'menus' ); register_nav_menu( 'primary', 'Top Nav' ); register_nav_menu( 'footer', ...
0
votes
0answers
11 views

How to add a custom menu to a certain post?

So with menus i know you can setup and have multiple different menus, but how can i set a particular post to use a certain menu? I'm doing this LearnDash - and i'd like to have a different menu for ...
0
votes
1answer
124 views

Remove current_page_parent nav class from blog index when in CPT

I'm trying to remove current_page_parent class from the blog index menu item (I got a custom page to display all blog posts and it is in the menu) when navigating custom post type archive page and ...
2
votes
1answer
44 views

how to only add a top-level admin menu without it creating a sub-level-menu

Here is a the code snippet: add_action( 'admin_menu', 'travel_site' ); function travel_site(){ add_menu_page( 'Travel Site Menu', 'Travel Site', 'manage_options', 'travel-site-menu', ...
0
votes
2answers
95 views

How to Add support for sub-menu item description in wordpress?

I am working on a Custom Nav Walker and I want to use Description field in wordpress menu in my theme. The field works fine as far as for First Level Menu items but when I add something in sub-menu ...
0
votes
1answer
27 views

Is it possible to separate all submenu items?

I'm using FoundationPress as a starter theme and I'm trying to separate the submenu. My theme basically generates menus like this: <ul> <li class=" first-level has-dropdown"> ...
1
vote
1answer
734 views

Menu item with no page, but with dropdown

I am using 2010 theme menu. Is it possible to have a menu item that has a drop down when hovered, but will not click though to a page/post. Just a dropdown, using the wp_nav_menu.
0
votes
0answers
14 views

How do i get the menu id currently being edited in the nav-menus.php page?

I am trying to get the ID of the menu currently being edited in the backend menus page( nav-menus.php ) under appearance. Is there any filter that returns the id of the current menu being edited ?
0
votes
0answers
27 views

Menus Removed from Custom Widget Area

I’m hoping someone out there can help me out with this issue I’ve been scratching my head about for some time now. At my place of employment we have a WordPress site on our intranet, running a child ...
0
votes
0answers
22 views

Make menu page not add to click count from homepage to comply with Google indexing practices

Hi WordPress StackExchange, My goal is to make my website be compliant with having 3 clicks or less to the homepage for the services section. I am trying to resolve this error: Documents more than ...
1
vote
2answers
2k views

Error “The given object ID is not that of a menu item” on menu with 40+ items

When ever I try to add menu items past about 40 I get an error "The given object ID is not that of a menu item" and many of my menu items will disappear from the menu at random. The site I am working ...
0
votes
2answers
154 views

Use wp_logout_url() in menu creation page

can anyone give me some idea about how I can use the value of wp_logout_url() within the menu creator page of wordpress? As the menu creation page doesn't support php I cannot just put echo ...
0
votes
1answer
28 views

Site-wide tabs at WordPress website?

Is there a solution to add tabs at the whole site (site-wide) and not just in posts and pages? For example: I need one "tabs group" consisted of 3 tabs, and I like to add it sitewide (the same ...
0
votes
0answers
28 views

Get parent item using Walker function

When using the Walker function I found out that the $item parameter contains the properties current_item_ancestor and current_item_parent but both are empty in all cases no matter if its a menu or a ...