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.
32
votes
3answers
29k views
Menu items description? Custom Walker for wp_nav_menu()
Normal Wordpress Menu looks like:
Home | Blog | About us | Contact
But I've seen many pages with descriptions under these links:
Home Page | Our Blogs | About us
| ...
40
votes
10answers
16k views
Display a portion/ branch of the menu tree using wp_nav_menu()
I have a menu defined in WP Admin that looks like this:
I want to be able to display all the child links on the sidebar whenever I am at a parent page. For example, if the user is on my "About Us" ...
11
votes
7answers
9k views
Changing the Order of Admin Menu Sections?
I am getting a bit frustrated over here after having spent a few hours trying to accomplish this fairly simple task without any luck.
Essentially I have 5 custom post types which I created and all I ...
10
votes
2answers
3k views
Adding an Arbitrary Link to the Admin Menu?
Is there a way to add a arbitrary hyperlink to the WordPress admin menu (I mean the menu on the left when you log into the admin dashboard)? For example, can one add a link to Google?
In my ...
1
vote
1answer
550 views
How to var_dump nav menu items from anywhere?
I wanna preview all the fields that the nav menu $item array holds. Is there a function to fetch it from anywhere and place it inside var_dump?
1
vote
1answer
729 views
How to use logout function on custom menu link?
All
I am using wordpress custom menu, and there is one menu as Logout.
I know wordpress Logout function <?php echo wp_logout_url(); ?>
But how can i use it in custom menu ?
12
votes
7answers
15k views
Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
(Moderators note: Was originally titled "wp_nav_menu Ancestor class without children in navigation structure")
I have a wp_nav_menu in my header which had three pages in it. When I am on one of those ...
18
votes
2answers
13k views
Any docs for wp_nav_menu's “items_wrap” argument?
I'm using wp_nav_menu and am trying to create custom output for the sub-level drop downs. I came across the "items_wrap" argument but there's really not much information as to what it is, how it ...
13
votes
4answers
5k 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]">
...
2
votes
1answer
515 views
Dynamically link to the latest post or simulate request of specific post in page template
I want to have a link in the wordpress menu pointing to the latest post of a specific category.
Because I am not able put a dynamic URL in the wordpress menu, my approach was to put a page with a ...
11
votes
2answers
5k views
How to add a custom field in the advanced menu properties?
Is it possible to add a custom field to menu items?
What I want to do is be able to add a field for 'French Navigation Label' and a 'French Title Attribute' in the wp menu interface.
0
votes
1answer
357 views
How to Use the Function is_user_logged_in To Display Different Menus?
So, I want to create different menus for people who are logged in or not.
I got a reply that i should use a function
if (is_user_logged_in()) {
wp_name_menu(array('theme_location' => ...
0
votes
1answer
335 views
Add log in link to menu in Twenty Twelve
I can't find a way to add the log in link to the new theme of WordPress, Twenty Twelve.
I did find a lot of answers on the older theme, where they suggest to add some code in the functions.php file. ...
11
votes
3answers
5k views
How to Hard Code Custom menu items
Is there any way that i can hard code the custom menu items when first theme installed? I am creating a theme which will automatically make some common pages when installed. So I need to know if I can ...
13
votes
2answers
12k views
How to use wp_nav_menu to create a select menu dropdown?
I'm using the following inside the wp_nav_menu function to create a select dropdown menu where each menu item is an option in the select dropdown...
'items_wrap' => ...
6
votes
2answers
1k views
How to add a custom metabox to the Menu Management admin screen?
Although I am very thankful to the wordpress core team that they have finally integrated native menu management capabilities I get frustrated with some key elements which I would like to change.
I ...
2
votes
4answers
2k views
Adding a class (arrows) to main menu links that have children?
I'm wondering if it is possible to add different classes to second/third/fourth/etc-level items that have children in Appearance > Menus tree?
That's how I call the menu:
<?php $menu_args = ...
0
votes
1answer
9k views
Creating Multiple Menus when using the TwentyTen Theme?
How to get multiple menus in TwentyTen theme?
2
votes
1answer
275 views
Create a formatted table-like menu
I've just put the site up a couple weeks ago and adding some more things to it for my friend however there's got to be an easier way to lay content out over wordpress. I've having a hard time with it ...
-2
votes
1answer
280 views
WordPress wp_nav_menu within iFrame
EDIT 2: How would I iFrame wp_nav_menu contents while maintaining the styles and script associated with their display? (Please ignore all of the below seemingly confusing context of why someone would ...
2
votes
2answers
109 views
How can I access the “description” of a menu item?
Where you can add your menu in under appearance > menus, I have descriptions in. In my page, I want to be able to echo out that description. Not in the menu, but in my page. How can I access this ...
9
votes
8answers
3k views
Adding first / last CSS classes to menus
is that possible, without javascript hacks?
like this:
<ul class="my_menu">
<li class="first"> ... </li>
<li> ... </li>
<li> ... </li>
<li ...
12
votes
2answers
9k views
Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?
Thanks to some help on here, I've managed to add a custom search box to my main menu... by adding this to my theme's functions.php
add_filter('wp_nav_menu_items','search_box_function');
function ...
3
votes
1answer
2k views
Show a WP 3.0 Custom Menu in an HTML Select with Auto-Navigation?
As part of a theme for a client, I want to be able to show a custom menu (defined via the admin) in a select box that automatically changes pages after changing the selection. Is there a plugin (or a ...
1
vote
2answers
530 views
How to Move the Author Metabox into the “Publish” metabox?
About a year ago I remember seeing a plugin or some code which allowed you to add an author dropdown menu to the post "publishing" metabox instead of it being on its own.
I can't seem to find this ...
4
votes
2answers
1k views
Custom Post Type Menus
I'm writing a plugin for work because our main website is being ported to WordPress eventually. I've got multiple custom post types planned for this plugin and would like to group them all into one ...
4
votes
3answers
2k views
non-clickable placeholder in the menu
well, I really would like one & more of my top-level menu items (parent menu items that has child menu items) to be non-clickable, so that visitors can only click on the child menu items...could ...
2
votes
3answers
6k views
How to get current-menu-item title as variable?
Is possible to get current-menu-item as a php variable?
I'm listing the category museums via the menu item 'museums we support' so i'd like the get 'museums we support' bit and display it somewhere?
...
4
votes
3answers
5k views
wp_nav_menu remove class and id from li
I'm new to wordpress and trying to learn my way through from making a theme.
Right now I am using wp_nav_menu to generate my menu
My menu consists of pages and categories
However, the default ...
1
vote
2answers
108 views
How to activate “Description” metabox for menu item programmatically?
I'm creating custom wordpress theme. How can I enable "Description" metabox for menu items (on nav-menu page) by default programmatically?
1
vote
2answers
2k views
wordpress custom walker for thumbnails with custom menu
I'm still very novice at PHP so any help is greatly appreciated. Typically I have found the codex to be very helpful but it appears custom walkers may be outside its scope.
I'd like to have ...
1
vote
2answers
599 views
Minor css-change based on topmenu - how?
I want to make minor css-changes based on the choice of the top (root) menu.
What's the proper way to handle this in WP?
//edit//
It's a website (pages), no blog, and basically, the colors of some ...
0
votes
1answer
926 views
How to style a specific nav menu item?
I have a site, which now have a new registration form and I want to highlight it by blinking the menu item. you can see the site here.
I wan to blink "Registration for seminar" item. I am using ...
3
votes
1answer
304 views
How to apply a class to the second word in menu list item?
I want to apply a class to a word in my menu. For example, say I have a list item in my menu called "My Item". I would like to apply a class to the word "Item" so that I can style it anyway I want.
...
2
votes
2answers
642 views
Add column to pages table
Hey all i am trying to find the section within the edit.php page where it populates the table with all my current pages. What i want to do is add another colum to the table in order to launch a side ...
1
vote
1answer
176 views
Can I add pages to my custom menu via script?
My theme has a custom menu assignment...
function my_register_my_menus() {
register_nav_menus(
array('header-menu' => __( 'Custom Header Menu' ) )
);
}
...and I'm creating an "installer" ...
0
votes
0answers
37 views
Editing menubar by repositiong search bar
I am using a free wordpress theme named Pitch (http://siteorigin.com/theme/pitch/) . I want to edit the main nav menu . I want put the search bar into the menubar . I did it by editing CSS , changing ...
0
votes
2answers
143 views
Remove navigation from header in custom page template
I'm building a landing page and want to remove the navigation menu from the page. The navigation menu is in header.php which is of course in the page template. Is there a WordPress function I can use ...
0
votes
2answers
529 views
wp_nav_menu not appearing correctly on category page
this is the code i am using to call wp_nav_menu
<?php
wp_nav_menu(
array(
'container_class' => 'menu-header',
'theme_location' => '',
...
0
votes
1answer
113 views
Why isn't the Settings API designed to work for plugins using custom admin menus? [duplicate]
Possible Duplicate:
How should one implement add_settings_error on custom menu pages?
The Settings API offers all sorts of labour saving features and future proof code. I find it really odd ...
8
votes
3answers
4k views
Programmatically add a Navigation menu and menu items
Through API functions, I want to define a new Navigation menu, select it in the current theme, and then insert a few Pages as menu items. This is to be done for instance on a theme activation.
...
4
votes
2answers
979 views
How can I create an auto-populated menu that is automatically assigned to a location?
I'm trying to add BuddyPress nav menu support to my theme and, unfortunately, BP's template tags still aren't fully up to snuff. (Basically, if you're not making an explicit child theme for the BP ...
9
votes
2answers
6k views
Generate a Menu that Displays Child Pages using wp_list_pages() with the New Menu Functionality in WordPress 3.0?
Previously, I was able to selectively load child pages for a currently-selected parent page using logic such as:
if( $post->post_parent ) {
$children = ...
4
votes
4answers
5k views
Add Class to Specific Link in Custom Menu
I know you can add a class in the custom menu options, but it adds it to the LI before the A. I want to apply the class directly to this specific A rather then the whole LI.
So instead of the output ...
3
votes
4answers
9k views
wordpress nav menu using twitter bootstrap
I'm using twitter bootstrap in my theme.
I'm trying to use bootstrap menu in my theme. But it use custom attributes like data-toggle.
Here is the full code.
<ul class="nav">
...
1
vote
2answers
1k views
Bar separated navigation by extending Walker_Nav_Menu
I have the following menu in my header:
<?php
$args = array(
'menu' => 'Main Menu',
'container' => false,
'depth' => 1,
'items_wrap' => ...
5
votes
2answers
1k views
Display Menu Name using wp_nav_menu
I have a custom menu that I can call just fine using wp_nav_menu. Is there a way to have the menu name displayed inside an h3 tag before the menu?
Ex.
<h3>My Menu Name</h3>
<nav>
...
4
votes
2answers
4k views
How to manually specify the current active page with wp_nav_menu()
Is there a way of manually specifying which page is currently "active" when using wp_nav_menu() ?
I have a "Products" page, and on that page i have links to various (dynamic) custom taxonomies. When ...
2
votes
1answer
209 views
Menu Items Disappearing
I'm running WP 3.5.1 and I've a menu with about 100 items. When I add new items to the menu older ones disappear.
I'm not running Suhosin or similar stuff. What can be the cause?
Note: I'm on a ...
1
vote
1answer
3k views
wp_get_nav_menu_items how to exclude sub level menu items?
I have the following function to output a custom menu in select format for a responsive design I'm working on.
It's working exactly how I want it to apart from I would need to exclude sub menu items. ...