Tagged Questions

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 (4)

0
votes
1answer
19 views

Add more levels to menu

I have a menu with more than three levels. The issue is that the menu just shows until level 2, the next child levels don't show. I am using Maya template and WordPress 3.5.2 What i have to do and ...
-1
votes
1answer
196 views

sidebar hierarchical menu category & custom post type

I'm working on a site with courses. I've created a custom post type "Course" and need to create a sidebar menu with the list of courses under the active category and then with anchor links to the ...
0
votes
1answer
121 views

How to include the parent page link in this wp_nav_menu walker

I've got a site with a sidebar of 'sub-navigation' I also need to have those links 'parent page' in the navigation also. So, for example I've got Parent child 1 child 2 child 3 but the php only ...
0
votes
1answer
48 views

How to conditionally add a wp_filter

I have a WP filter I created that I only want to run on certain menu items. I am attempting to use - function add_nav_class($output) { $output= preg_replace('/<a/', '<a class="lsbb"', ...
0
votes
1answer
184 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( ...
0
votes
1answer
138 views

Where these arguments are defined?

I want to make 2-line navi, and found this code. add_filter('walker_nav_menu_start_el', 'description_in_nav_el', 10, 4); function description_in_nav_el($item_output, $item, $depth, $args) { ...
0
votes
2answers
645 views

How do I programatically insert a new menu item?

I'm developing a plugin and I want to insert menu items programmatically. When my theme creates a menu, it uses this call: wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => ...
1
vote
1answer
231 views

Different menu navigation per category

Hello all you helpful people :) I am using a self modified version of the 2012 theme and I would like to be able to display a different main navigation menu based on the category I am viewing. ...
0
votes
3answers
3k views

current-menu-item class for custom post type parent

Im having a problem with my menu and custom post type. I have a custom post type of "services". I have created new page for it called Services. On that page Im displaying a list of all the post from ...
0
votes
1answer
523 views

Show only second level menu items? [duplicate]

Something like this. I would like to get only the second level menu items, not their parent items. Home Sub Menu Item 1 Sub Menu Item 2 About Sub Menu Item 3 Sub Menu Item 4 For example, from ...
1
vote
3answers
4k 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 ...
0
votes
2answers
74 views

Change appearance based on category but post is in two main categories

I want to change header and menu based on what category a post is listed in. I could duplicate the post and assigned each of the two categories separately but this sounds messy and bleh. The post/s ...
0
votes
1answer
23 views

Opening Menu link in another tab

I am adding a link to my Menu: Everything is working correctly except I would like the link to open in another tab and can't figure out how to. How would I do this?
0
votes
1answer
54 views

How to use page metadata while using wp_list_pages()?

I'm creating my pages links in wordpress, using wp_list_pages(). each link contains an <i> tag which displays retina icons. I want to set a different class for each link in order to display a ...
0
votes
1answer
169 views

wp_nav_menu changed to wp_page_menu

I've styled my navigation menu with the classes of wp_nav_menu .menu_item , .sub_menu etc.When i added a new page suddenly the whole menu was ruined the classes where changed to .page_item, .children ...
1
vote
0answers
128 views

Walker Class - Check if menu item has description and if so add class to li

I am using a pretty common walker class to pull in the description when I call the wp_nav_menu function. I am using this to add an optional second line for the menu, using the description. This of ...
0
votes
1answer
29 views

Add item ONLY to the primairy navigation

this code add the proper "home" to navigation... what i try to get is add home to ANLY the primairy navigation, how do i target the "main" only function new_nav_menu_items($items) { $lang = ...
2
votes
1answer
2k views

Show top-level parent with submenu menu walker

I've used the menu walker below to display dynamic submenus with great effect in the past. It displays 2nd- or lower-level menu items IF the current page is a parent, sibling, or descendant of the ...
0
votes
0answers
116 views

Link to Author archive from Navigation Menus in dashboard?

I'd like to display a grid of authors on my site showing the name of the author and their avatar. The tricky part is, I'd like to be able to control this from the Menus page in the dashboard so I have ...
0
votes
1answer
1k views

wp_nav_menu in 3.7 add name class nav navbar-nav

i work with bootstrap3 and wordpress 3.6 but upgrade to 3.7 function wp_nav_menu not work correctly. i use 3.6 <nav class="navbar navbar-inverse"> <?php wp_nav_menu( array( ...
2
votes
2answers
379 views

How to create different navigation for registered users in WooThemes Canvas?

I'm building a website with wordpress and the Canvas Theme (from WooThemes). I'm using the Top navigation for displaying items when a user is logged in. When the user is not logged in, you can see ...
1
vote
0answers
257 views

wordpress register nav menu not showing in admin

I am using the following code to register a menu for my theme. In functions.php I have written the following: register_nav_menu( 'header-menu', __( 'Header Menu' ) ); When going into wp-admin ...
1
vote
2answers
79 views

Create subpages in default Wordpress menu

I've got this code below working to create a default menu. I was wondering how I would create sub-items/subpages... // Check if the menu exists $menu_exists = wp_get_nav_menu_object('Main Menu'); ...
0
votes
1answer
635 views

Overriding wp_nav_menu default arguments

I'm trying to override WordPress' default arguments for the wp_nav_menu function, while still allowing programmers the ability to pass their own arguments. The wp_nav_menu_args filter seems like the ...
0
votes
1answer
58 views

Adding two submenus to a menu

I have a menu(ads) that contains 2 submenus(view and manage). I want that both menu item redirect to different pages, but my 1st submenu(view) is directing to the main menu page.
6
votes
1answer
313 views

Check if add_menu_page exists or not

I'm working on a plugin that I have to release in parts. The problem is, if there is a menu in the page then add the new plugin to the 2nd or next submenu else add a new menu and then add the plugin ...
0
votes
1answer
91 views

Menu link to all posts (all categories included)

In WordPress how can I add a menu link to an archive for Posts? I can see that I can add category archive links but what if I want to have an archive of all the posts (therefore including all ...
1
vote
2answers
86 views

Multiple languages menus problem

I'm trying to add language option to my website. I've coded my theme and I need to show the web in three different languages. I've got the little flags and I've managed to pass a php variable with the ...
0
votes
1answer
136 views

How to create a complete mulilanguage site using xili language plugin?

I am using xili language plugin for create a multi language site. Using this i can create posts and pages on different languages. But when i switch to other language the menus doesn't converted to ...
0
votes
0answers
167 views

How do i keep my current page menu highlighted on pagination?

I have a navigation menu in a page that highlights the current menu you’re on based on the URL by adding a class. My problem is that my page is paginated, so sometimes the user will end up at: ...
2
votes
1answer
1k views

Custom wp_nav_menu output (displaying all child elements of top menu element in current branch)

I would like to create a walker function, or modify somehow current wp_nav_menus so it can produce a custom output. Let's imagine this structure: menu item 1 menu item 2 submenu item a submenu item ...
0
votes
1answer
2k views

Active class to current link

How do I add the active class to the current link that the user is viewing? I have a mixture of pages and custom post types in my main nav menu and I know that wordpress has .current_page_item that ...
0
votes
1answer
33 views

Making pages in a menu appear conditionally

How do I make a page (dis)appear conditionally in a menu? I had something like this in mind: if(condition) //show_page_in_menu I would prefer an answer that doesn't incorporate an external ...
0
votes
2answers
167 views

Set menu item class into body

I set css class for menu items. I want to get css class of current menu item and set it to body tag. What should i do ?
0
votes
0answers
26 views

How to create a menu super voice in WP?

I am pretty new in WP (I came from Joomla) and I am finding some difficulties to do the following operation in WP Main Menu. If you go on this site you can easy understand what I need: ...
0
votes
2answers
351 views

How to use wp_nav_menu with hashtag links?

I am developing a custom theme and the navigation part uses hashtags (yes, all content is on one page). So when i use wp_nav_menu( array( 'theme_location' etc the menu items links to the pages. Can ...
0
votes
1answer
546 views

How do I check if a menu exists?

I'm currently retrieving a nav menu based on the parent page's title, and if the page doesn't have a parent then it's own title. global $post; $page_title; if ($post->post_parent) { ...
0
votes
1answer
155 views

Update nav menu item position programmatically

I've tried adding a new programmatically on wordpress with the function: wp_update_nav_menu_item($menu, 0, array('menu-item-title' => $title, 'menu-item-object' => 'page', ...
0
votes
0answers
15 views

Limit the amount of menus someone can make

Working on a site of mine I was wondering if it would be possible to set/limit the amount of menus someone can make to '1' (and thereby disabling the current menu location features)? I've been ...
0
votes
1answer
798 views

Custom menus created but does not show up in admin panel

I am developing a theme of my own. In functions.php I added - add_action( 'init', 'register_my_menus' ); function register_my_menus() { register_nav_menus( array( 'front_login_menu' ...
-3
votes
1answer
752 views

creating a left-side sidebar in word press [closed]

I would like to know how to create a side bar on the left-side.I have a site containing a sidebar in the right side.I need a sidebar in the left side too. Please help me.
1
vote
1answer
498 views

Menu fallback “menu_class” rendering a “div” instead of a “ul”

I'm working on a fallback menu for a WordPress theme I'm working on. The main menu's menu_class renders a ul which is what I want. However, if I use the menu fallback, the menu_class renders a div ...
0
votes
1answer
388 views

Splitting up a submenu into columns, or putting existing menus in another menu as submenu item

I have a menu with a long list of submenu items. I'd like to split that up into columns and the easiest way in my mind would be to have them split up into multiple . Is there a way to do this? ...
0
votes
2answers
239 views

Why wp_nav_menu() doesnt show the proper meny when invoked two consecutive times?

I just noticed something weird I never saw before. I'm working on a project using WP 3.6.1. This project that has two different menus (actually, three, but that's not important). I'm calling them ...
1
vote
1answer
121 views

Home Custom Menu Link not Working

I'm trying to have the menu link per default when using my custom menus, and in my functions.php document I have this: function home_page_menu_args( $args ) { $args['show_home'] = true; ...
0
votes
1answer
20 views

Creating custom menu with custom themes

I have created my own custom WordPress theme and am now trying to implement the custom menu. I noticed with the default theme that when I went to Appearance > Menus, I was able to create my menu ...
0
votes
1answer
1k views

How to add class to anchor using wp_nav_menu

Sorry if my post duplicate but i can't find best solution for my problem. I'm newbie on develop WP theme. Now i'd like to add class to current li and last li, but i don't know how to do? Hope someone ...
0
votes
1answer
62 views

how to change/remove/hide menu under installed plugins

Recently I install one plugin. After installing the "bookingwizz" plugin, the menu added in menu. Under bookingwizz I now have some submenu as well. Now I don't need all those menu items, but want to ...
0
votes
1answer
613 views

Modify the output of wp_nav_menu in a very specific way?

I am trying to get wp_nav_menu to output something like this: <div id="topMenu" class="spanningMenu noPrint"> <ul> <li class="topMenuDivider"></li> ...
0
votes
0answers
26 views

Plugins for putting Custom Post Types into the Menu

I have been building a website that has numerous custom post types, and I have found one called WordPress Post Type Archive Links. This would allow me to add a link to the an archive of registered ...