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.
2
votes
3answers
619 views
Hide and show menu subpages
I am sorry if this is not clear, but I am using translated wordpress so I am translating some names back.
I have pages in menu and when I click on some item it goes to that page. But I need f. e. ...
2
votes
2answers
3k views
How can I show different menu for different pages?
I have a website that has a main menu(Top-Horizontal) like this:
Main menu
- Home
- About Us
- contact us
On Home page I have a link to "Company" page like this www.xyz.com/company.
When I am ...
2
votes
1answer
1k views
Not able to get current menu ID
I'm trying to get the current menu item ID. I hve found one thread that has put me on the right track: How to get current-menu-item title as variable?
This is the code I use in my function.php ...
2
votes
1answer
295 views
Custom Menus, Widgets & Conditional Statements
I'm employing custom widgets for my client because it's easy and they have several menus they need to create specific to site sections. I then want to allow them to add to the custom menu dynamically ...
2
votes
1answer
310 views
how to assign more permission to wordpress author
I have installed jw player plugin so that users of my site could upload their videos. Right now, admin can only see jw player menu on the admin panel and he can only upload videos and use this plugin. ...
2
votes
1answer
262 views
How to assign a WP 3.0 custom nav menu to a theme's navigation menu location via script?
I'm using this script inside a plugin to create a new custom menu on the fly and assign a page to it...
$menu_id = wp_create_nav_menu( 'header-menu' );
$menu = array( 'menu-item-type' => 'custom', ...
2
votes
3answers
2k views
Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?
I've found this new plugin
http://wpsmith.net/wordpress/creating-multiple-custom-menus-in-wordpress-3-1
that is using a new 3.1 hook (wp_nav_menu_objects) to remove specific nav-menu-items from the ...
2
votes
1answer
676 views
How to Programically add to the new WordPress menus
Pre WordPress 3.x I was using:
add_action( 'init', 'product_register' );
add_filter( 'wp_page_menu', 'custom_page_nav', 90 );
function product_register()
{
// register_post_type( 'product', ...
2
votes
1answer
290 views
Where do custom menus get constructed?
I've created a simple menu in wp-admin>appearance>menus called main-nav. Works fine.
However, I'd like to add a custom element to the end of the menu... a search box like the search box in the ...
2
votes
1answer
121 views
Nav Walker current menu item not displaying
I'm building a theme on top of a starter theme (wp-bootstrap) and am having trouble getting the Nav Walker to show the current menu item. current-menu-item is not there when I use a web inspector on ...
2
votes
0answers
67 views
Warnings in nav-menu when visiting query pages
Using query-wrangler, similar to drupal's views, I created some query pages.
When I visit these pages, in the top-navigation-menu there is this warning:
Warning: in_array() expects parameter 2 to be ...
2
votes
0answers
77 views
How to move parent li to end of child ul
I'm working on translating a site from HTML/CSS to Wordpress, and I've come across an issue. In the spirit of keeping the site fully customizable from the dashboard, I've been using Wordpress' default ...
2
votes
1answer
775 views
Vertical Sidebar Menu Parent and Child not displaying correctly
I am developing a WordPress site and trying to display my menu correctly. How can I display all Parent items but only show the Child items when it's Parent has been selected. I hope that makes sense. ...
2
votes
0answers
45 views
How do I approach removing menu items on the fly based on settings in my plugin?
I've started writing a plugin that allows the administrator to select specific pages and set them to be visible only to logged-in users; the plugin optionally applies the restriction to all child ...
2
votes
1answer
135 views
Determine if a navigation item has children
I am trying to determine if an item has a sub-item with depth 1 or higher. I cannot find anywhere if there is some function/query I can write that grabs the current item looks in the database if it ...
2
votes
1answer
103 views
Add section to custom menu panel
I would like to add a new section in the custom menu panel that would allow predetermined URLs to be added to a custom menu.
For example, I would like a custom post type archive page. I know that ...
2
votes
0answers
107 views
display only the wp_nav_menu, which has the current-menu-item
i have a problem displaying only the menu with wp_nav_menu, in which the current-menu-item is in.
Heres what i got:
function register_menus() {
register_nav_menus(
array(
'sidebar-menu' ...
2
votes
0answers
208 views
Adding Custom Taxonomy Archive Link to Nav Menu Shows Up As (Invalid)
I have a custom post type "packages" with a taxonomy "Celebrations" that has a few terms in it.
When I try to add a link to my wp nav menu through Appearance > Menus and choosing the term I want from ...
2
votes
1answer
165 views
Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?
Essentially I'm trying to add multiple sub nav menus and I'm pretty close but I just can't seem to find the right tack to solve my problem ...
I'm using a variation of a Stu Nichols CSS Menu ...
...
2
votes
1answer
2k views
How show sub menu only using wp_nav_menu()
I am using this code to show the custom menu subpages if you are on the parent page. But what this code also shows is a parent page on a page that has no sub menu, which I would like hidden. Basically ...
2
votes
0answers
137 views
wp_list_pages sort order is different for different languages [closed]
I'm using the following code
wp_list_pages(array('exclude' => '','title_li' => '','sort_column' => 'menu_order'))
If I switch the language the sorting is different. One of the main menu ...
2
votes
0answers
78 views
Strange behavor of wp_nav_menu by not appearing [closed]
It is in header.php
wp_nav_menu(array('theme_location' => 'top-nav','container_class' => '', 'fallback_cb' => ''));
in functions.php
function register_custom_menus(){
...
2
votes
1answer
132 views
Add a specific category at a specific place to the menu that uses wp_list_pages
I have a main menu where I display pages. All the pages have associated sub-pages, however in the menu some of them are displayed by themselves without sub-pages and some are displayed with a submenu ...
2
votes
2answers
3k views
Navigation menu with children shown only for current page
I've been playing around with Wordpress' menu functionality (wp_nav_menu and wp_list_pages) to build a menu for my site. It's coming along, but I'm still having some trouble getting the behaviour I'd ...
1
vote
4answers
382 views
Remove Metabox from Menus screen
Been digging into WP files for a bit and think I just might be missing something. The end-goal is to remove the Theme Locations metabox from the Menus screen if someone doesn't have a certain ...
1
vote
1answer
1k views
change front end menu depending on user login
How can i change my front end menu depending on if the user is logged in or not?
For Example:
View 1: user is not logged in
menu is : home , about us, testimonials
View 2: user is logged in
menu ...
1
vote
5answers
5k views
Removing container from wp_nav_menu not working
I'm converting this html menu to wordpress:
<ul>
<li><a href="/" class="current"><span>Home</span></a></li>
<li><a ...
1
vote
2answers
923 views
How to change the admin menu “Pages” to something else
When one creates a custom post type you have the ability to define various elements related to that post type which essentially allow you to define things such as the menu title, "add new post" text ...
1
vote
1answer
409 views
Using a menu walker add a custom item at the end of the menu's items
I need to add a search field at the end of a menu in a list item.
I've been looking at walkers but finding it really hard to figure out what is the last item (or even get the total). Also where would ...
1
vote
3answers
136 views
Remove the whole menu in the admin
How can i remove the whole menu in the admin?
I have this code:
function remove_menu_items() {
global $menu;
end( $menu );
while ( prev($menu) ) {
$value = explode( ' ', $menu[ ...
1
vote
2answers
781 views
Force PDF download from custom menu?
I added a link to a PDF in my custom navigation menu. Is there a way to force it to download instead of open?
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 ...
1
vote
1answer
3k views
How to add posts to custom menus?
I'm just beginning to work the "Custom Menu" functionality that was introduced in 3.0 into my theme.
I like everything about this new capability and API, with one exception: Why no posts?
I can ...
1
vote
3answers
2k views
removing <li> tags from wp_list_pages() using PHP
as the title states, I am trying to remove the <li></li> tags from the list that gets generated with wp_list_pages().
My thinking is to somehow run a for/foreach loop through the menu ...
1
vote
1answer
443 views
How to specify or extend the CSS-class of a menu item?
is there a way to allow admin users to add classes to individual menu items in the back end? we have done some individual javascripting and CSS using the title tag, but that is not flexible as it is ...
1
vote
2answers
485 views
Wordpress Menu Disappears when $query->query_vars['meta_key'] is set
I've set some meta variables on my WP posts. I want to be able to sort by these variables, and everything is working great except when I sort by either "views" or "likes". When I sort by either of ...
1
vote
4answers
1k views
wp_nav_menu, add class to every nth item?
is there a way to add a class to every nth item in a menu using wp_nav_menu?
Trying to create columns but need to add a 'last' class to the 3rd item.
cheers! Dc
1
vote
1answer
265 views
Wordpress default menu in database
There are 3 menus in my wordpress(3.5) now.
Main menu (default from wp)
Footer menu (default from wp)
Test menu
Now I have kept test menu as default.
Where does Wordpress store this thing?
I ...
1
vote
1answer
546 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
2answers
370 views
Is it possible to add classes to list items in wp_nav_menu()?
I am using
<?php
wp_nav_menu(
array(
'theme_location' => 'header-menu',
'menu_class' => 'nav-bar',
'container' => 'nav'
)
);
?>
to output my ...
1
vote
1answer
612 views
Add an extra field to the navigation menu box?
Goal:
I like to use a subtitle in the navigation bar.
The most logic location, in my opinion, would be Appearance > Menu and add a field below navigation label called subtitle. So the end user can ...
1
vote
2answers
1k views
How to display 2 equal columns of li based on the count of items in wp_nav_menu divided by 2?
I would like to display a custom 3.0 menu in my sidebar. I want the list to be in order of name, and the list to be sequential down the list of the left column and flow down, then into the right ...
1
vote
2answers
505 views
How do I pass an argument to my custom walker?
I've set up a custom walker, and it works as desired when I hard code my variable.
What I want is to be able to call my walker and pass it a variable that is used in the walker.
For example:
...
1
vote
2answers
1k views
How to insert custom code into wp_nav_menu structure?
I was able to use <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => false ) ); ?> to create the menu within my theme. Messed around with 'items_wrap' but ...
1
vote
2answers
319 views
Main menu - get rid of titles?
I've got a default main menu:
wp_nav_menu();
But it gives a list of links in a form:
(...)
<a href="link" title="PageName">PageName</a>
(...)
The very important question is, how to ...
1
vote
1answer
1k views
How to remove class attributes from custom menu markup?
Just playing around with adding "custom menu" support to my theme. I'm super excited about it.
HOWEVER,
Check this out >
<ul id="menu-my-main-menu" class="menu">
<li id="menu-item-12"
...
1
vote
2answers
3k views
How to add (css) classes to only one wp_nav_menu()?
Edit
I removed the original Question as this Q has far above 1.000 views now - which means it's important to a lot of people - to show you something that works a) without a custom Walker & b) is ...
1
vote
2answers
120 views
Building a Sub-menu: Display Parent Category/Page's Children When Viewing Children
I would like a sub-menu in which the user visits a page, post, or category (in this example, "info") and is then displayed a list of children categories/pages. Not a dropdown menu, but a menu that ...
1
vote
1answer
143 views
Recreating the hierarchy of taxonomies for a dropdown form menu?
I have a form that contains a dropdown menu. This form is on a page form.php and is not part of my theme. It exists outside of my site. This dropdown menu contains my list of values for a custom ...
1
vote
1answer
107 views
Menus like a CMS
Here is an example structure of some content:
Parent A
-- Child A
-- Child B
Parent B
-- Child C
-- Child D
Parent A should link to the content of Child A and Parent B should link to the content of ...