Tagged Questions
0
votes
1answer
23 views
changing the labels inside appearance -> menus for some for the fields
So I've create a custom walker for nav menu (i am talking about the menus located at:
appearance -> menu -> add a new menu.
I now use the following for several things i need:
URL
Title Attribute
CSS ...
0
votes
1answer
45 views
Add <span> within the <li> output of <? wp_nav_menu() ?>
Im currently printing out:
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
Which outputs:
<div class="menu">
<ul>
<li ...
0
votes
0answers
35 views
Custom Nav Walker menu - Don't display children count [closed]
please can you help me not to display those posts quantity in WP nav-menu's brackets?
Nav menu code goes like this:
<nav id="menu">
<?php wp_nav_menu( array(
...
0
votes
1answer
36 views
wp_nav_menu - Collapse with PHP
How can wp_nav_menu be used to collapse and expand elements with PHP? Some walker function? Plugin maybe?
What it looks like in wp-admin menus
About
Customers
Cases
Contact
Contact us
...
0
votes
1answer
40 views
How to get current pages menu text?
Is there an easy way of outputting the current pages menu text?
I am looking for something like
<?php echo get_the_title(); ?>
But for the current pages menu text.
0
votes
1answer
72 views
Costum walker with sub menu item count
I have a menu like:
-Item1
--Sub1
--Sub2
--Sub3
--Sub4
--Sub5
--Sub6
-Item2
-Item3
and want to do some costum stuff after x subitems, so I have to determine when x is reached. I tried to define a ...
0
votes
1answer
67 views
Does the 'nav_menu_css_class' filter accept 2 or 3 arguments?
I've been using the nav_menu_css_class filter in one of my plugins, implemented as:
add_filter( 'nav_menu_css_class', 'wbwcrf_nav_menu_css_class', 10, 3 );
function wbwcrf_nav_menu_css_class( ...
0
votes
1answer
230 views
Custom Nav Walker menu - Display children count
I have a custom walker menu.( See the code below)
I would like to have my nav menu like this
----------------------------------
Home | link1 | link2 | link3 (5)
----------------------------------
...
1
vote
1answer
130 views
Custom Nav Walker to show siblings and children of current branch?
I have seen very similar (if not exact) queries to this all over Google, but always seem to find something short of what I need. I am trying to create my full vertical menu using wp_nav_menu in my ...
7
votes
1answer
705 views
Custom Nav walker display current menu item children, or siblings on no children
I've been messing around / searching for hours and still can't get this to work, so i'm finally giving in and asking for some help.
I'm trying to write a custom walker that shows only the current ...
0
votes
1answer
40 views
Custom Links in Walker Class
I am creating a custom walker class.
I need to identify the custom links that will be added to the menu from Appearace > Menu > Custom Link
so that they will have a different format to the page/post ...
0
votes
1answer
305 views
Adding attributes to <a> link in wp_nav_menu using custom Walker function
I am trying to generate a menu using wp_nav_menu. My expected output is this:
<!-- Main Menu -->
<div class="navbar navbar-blue navbar-fixed-top" style="margin-top:74px">
...
0
votes
0answers
19 views
How to get the excerpt in nav menu walker? [duplicate]
Possible Duplicate:
How can I access the “description” of a menu item?
This leads on from my previous question. I now need the excerpt instead of the nav menu description as not all pages ...
2
votes
1answer
140 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 ...
0
votes
1answer
226 views
custom walker to add iconfont to wp_nav_menu
I want to add the font awesome iconfont to my menu list items, so I need to make a custom Walker.
Because the font per menu item will be different I was hoping to use the css class in the WP backend ...
0
votes
1answer
93 views
Walker_Nav_Menu creating too many closing tags?
created this walker below to create a set of tabs. All looks ok but in the source there are several more than there should be causing validation errors.
I only want to generate a tab for 'question' ...
4
votes
2answers
106 views
Call custom field into menu item
I have a navigation menu in Wordpress. I would like it to check if the page has a custom field of "menu_icon" and if it does, add that custom field into the menu item it corresponds to. I'm sure this ...
0
votes
2answers
1k views
add span class inside wp_nav_menu link anchor tag
I found examples adding a class to top level items, so we can display an arrow in menu items with sub-items, but is seems terrible to cope with the already built in WordPress classes, can't display ...
3
votes
1answer
232 views
Extend walker class with custom post types
I'm using the walker class below, but I can't make it work with custom posts.
class Zwp_Walker_Nav_Menu_Dynamic extends Walker_Nav_Menu {
function end_el(&$output, $item, $depth) {
...
-1
votes
1answer
73 views
Navigation won’t update to show full path to single post
I have a site with a custom post type “projects” and two taxonomies “clients” and “mediums”. For the navigation I’m using a custom nav walker (that extends Walker_Nav_Menu). This all works very well ...
0
votes
1answer
165 views
wp_nav_menu check both hierarchy fail?
I see that in menu exist to kind of hierarchy to find the parent and ancestor.
They look for "category or page" hierarchy or for "menu item" hierarchy.
But when both exist in a depth tree branch, ...
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 ...
...
1
vote
0answers
196 views
wp_nav_menu custom walker - child items
I have written a custom walker to integrate a jquery dropdown nav script into my wp template. I need to add .dropdown-link to each of my parent menu items and .dropdown-wrapper to the unordered list ...
0
votes
2answers
712 views
Adding html elements to wp nav menu
I know how to create wp menus using the functions.php and diaplay it in my sote wherever the menu is required (e.g top menu, footer menu)
I even know how to style it using custom CSS.
I would like to ...
0
votes
1answer
825 views
Getting menu items like get_pages
I need a way to create a custom HTML template for the wp_nav_menu function. I've heard of custom walker classes, but these don't appear to be helpful enough to achieve what I'm trying to do; at least ...
1
vote
0answers
247 views
Help with walker for nav
For some reason, this walker won't work when I pass in 'echo ' => 0, it always prints the nav, and never returns the nav as a var. I can't seem to figure out where it's by passing that in ...
1
vote
1answer
444 views
wp_nav_menu, walker class, categories as classes of li
OK I'm trying to show my principal menu so I use the following code:
<?php $defaults = array(
'theme_location' => '',
'menu' => '',
'container' => false,
...
1
vote
0answers
319 views
Custom Walker for wp_list_categories
I need some help with making of one Walker Class. Now I’m having a menu with categories and in the dropdown there are some subcategories. The menu is something like that:
<div ...
2
votes
1answer
672 views
Add a custom walkter to a menu created in a widget
I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu ...
3
votes
2answers
1k views
WordPress Menu Custom Walker Class
We are using a jQuery UI accordian to render a menu in the sidebar. We've already written the markup and javascript and I am just trying to get the wp_nav_menu to output the same markup we've already ...
1
vote
1answer
414 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 ...
0
votes
2answers
264 views
Nav Menu – Add class based on meta keys
I'm trying to find a way that changes the classes of the different nav menu items, based on the value of a meta key in the page.
The menu currently looks like this:
<li ...
1
vote
1answer
961 views
Sub-Pages only of menu items in current branch using a custom menu
Although I did a thorough research I could not find a solution. Only solutions coming close.
My custom menu ("top") shows this structure (you see a part of it):
page 1
subpage 1.1
category A
...
1
vote
2answers
229 views
wp_list_pages() but only show children on the branch you are on
Lets say I have this menu:
Top
|___ Sub 1
|___ Sub Sub 1
|___ Sub Sub 2
|___ Sub Sub 3
|___ Sub Sub 4
|___ Sub 2
...
3
votes
1answer
1k views
Why is my menu order not working with wp_nav_menu?
I have a custom menu using the new Menu System but it is not returning in the correct order. I have no idea what order its in - its not alphabetical, or by date, or by any pattern I can see.
The link ...
1
vote
2answers
86 views
Querying both pages and posts
I am building an "advent calendar" for a client and they are wanting a combination of specific pages and custom posts appearing on the front page, in a specific order.
Things that need to be ...
1
vote
3answers
2k views
How to count nav menu items?
I'm creating a custom walker for my nav menu. The goal is to split the menu in to columns like so:
I can easily determine where I am in the list by looking at $item->menu_order. What I don't ...
0
votes
2answers
2k views
I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
I am trying to extend the Walker_Nav_Menu walker to make some changes to the way WP outputs menus. The method I have to override is start_el, so I created my Walker and copied the base method:
...
5
votes
1answer
3k views
Display only page specific sub menu items using Custom Walker
I've just implemented the technique described at http://wordpress.org/support/topic/wp_nav_menu-list-only-2nd-level-separate-submenu/page/2 when implementing a theme for a client. When I run the theme ...
1
vote
2answers
510 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:
...
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 = ...
1
vote
1answer
308 views
Bar separated navigation by extending Walker_Page
This question follows on from this one:
Bar separated navigation by extending Walker_Nav_Menu
I'm trying to do the same thing but this time I'm extending Walker_Page instead.
The issue I'm having ...
6
votes
2answers
557 views
Add Caret to Menu Items with Sub-Menus in WordPress Theme
I'm working on a custom theme using wp_nav_menu(). What I want to do is add a caret to menu items that have sub-menus. For example, If my menu looks like this:
Menu Item 1
Menu Item 2
Menu Item ...
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' => ...
32
votes
3answers
30k 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
| ...