0
votes
0answers
18 views

add classes to wordpress menu links

As the title already says, I am trying to add classes on the WordPress menu item links (so not the li, but the a element). If it is possible to achieve something similar to WordPress its own function ...
1
vote
1answer
173 views

Run a filter when a walker runs

Is there any way to run a particular add_filter function whenever a specific Walker_Nav_Menu class runs? The function always needs to run when the walker goes, and I'd like them to share variables, in ...
7
votes
1answer
421 views

Mega Menu Walker

I'm trying to create a mega menu walker. Unfortunately, walkers completely escape my coding knowledge. I could really use some help getting it working. Here's the features I need: Wrap the ...
0
votes
0answers
35 views

automatically adding submenu items

Here's the solution that @bainternet has posted here: Add child pages automatically to nav menu /** * auto_child_page_menu * * class to add top level page menu items all child pages on the fly * ...
0
votes
0answers
54 views

Custom Menu echo own HTML

I've registered a custom menu and got all that set up, however the formatting of the HTML that the menu uses doesn't fit with the CSS/HTML menus I had previously and want to keep. Therefore I was ...
1
vote
2answers
52 views

Detecting classes, adding widgets, and adding divs in with a Nav Walker

I've been trying to figure this out for days, to no avail. A template I'm building requires a mega menu. The markup for the menu looks like this: <nav> <ul> <li><a ...
1
vote
1answer
27 views

Make parent page only link to first subpage

I'd like to automatically make any parent page link to it's first subpage if it has one. Like so: Parent 1 (/#subpage-1) Subpage 1 (/#subpage-1) Subpage 2 (/#subpage-2) Subpage 3 (/#subpage-3) ...
0
votes
2answers
65 views

Logout hyperlink within a sub-menu

I have the following secondary navigation menu on my website which has been built using the native WordPress Appearance > Menus feature: I am also using the following lines of code in my ...
0
votes
1answer
71 views

current_page_item is missing inside wp_nav_menu

I'm using the function wp_nav_menu like this: <?php wp_nav_menu( array( 'container' => false, 'echo' => true, ...
1
vote
1answer
55 views

Logout and redirect using the WP Menu

I have a navigation hyperlink in my secondary menu, that will allow the user to logout: However, the user is prompted with the following screen for confirmation, when clicking on the hyperlink in ...
0
votes
1answer
201 views

Display Buddypress notification bubble on single menu

I am trying to get the Buddypress notification bubble to appear in one of my two navigation bars. I was given this code to place in my functions.php which does everything, except it displays in both ...
0
votes
1answer
69 views

Add login hyperlink to secondary navigation menu

I have the following lines of code in my functions.php file: #-----------------------------------------------------------------# # Custom menu ...
0
votes
1answer
21 views

search form leads to 404

I'm using the follow code in my functions.php to add a search box to my primary nav menu - add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2); function add_search_box_to_menu( ...
0
votes
1answer
52 views

How to change menu order item

Hello I have a main menu in my website Home | How to start | about | contact | categories but I add one item that lists all categories in functions.php add_filter('wp_nav_menu_items', ...
1
vote
1answer
154 views

How to show only one category in breadcrumb navigation

I added breadcrumb navigation to WordPress & I'm facing one problem. Here's the function.php code of the breadcrumb: function ux_breadcrumbs() { if (!is_home()) { echo '<a href="'; ...
0
votes
1answer
50 views

Unable to add extra elements to the main navi (wp_nav_menu_items)

I'm trying to get the list of authors to automatically appear on the main navi (without having to manually add them one by one as they are created). So far I added this on my functions.php, but no ...
0
votes
1answer
212 views

Editing or filtering the output of the Genesis navigation

I'm trying to edit or apply a filter to the default Genesis navigation genesis_do_nav Currently I'm extending a Walker class to add a <span> with data-attribute around the navigation's link ...
0
votes
0answers
28 views

Add custom css to menu while using custom nav_menu_tag

I created a custom menu to replace my li with td markers. However, I need to be able to add some custom tags through the wordpress menu. How do I do so? Is there something I can add to my ...
0
votes
1answer
38 views

Breadcrumb how i can display page title with parent > child title with permalink ? any Idea

function the_breadcrumb() { global $post; if (!is_home()) { echo ""; if(is_single()): echo 'Main'; else: echo "Home"; endif; echo " / "; if ( ...
0
votes
1answer
124 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( ...
1
vote
3answers
3k 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 ...
1
vote
1answer
330 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
0answers
27 views

Strict Standards: Declaration of … should be compatible with [duplicate]

I try this answer, and i changed the function start_el(&$output, $item, $depth = 0, $args = array() ) { but it did not work. The problem is, I have this theme, link here. and I'm getting this ...
0
votes
1answer
86 views

Remove submenu item from list

I have the following script within my functions.php file to avoid certain users from modifying things they shouldn't and would like to remove one more item, the Appearances > Themes submenu. function ...
3
votes
1answer
231 views

Determine which theme location a wp_get_nav_menu_items is for

Is there a way to determine which theme placement a menu is for when modifying it with the wp_get_nav_menu_items filter hook? I'd like to only add items to certain menus and I don't want to have to ...
0
votes
0answers
408 views

How to add a class name to the ancestor <li> of a post?

I've asked this question before with a different Question Title over at Stackoverflow. At that time, I was not yet aware that a function of the theme is adding a class name called current-menu-item. ...
0
votes
1answer
282 views

PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content

I wish to use accordion menu http://wordpress.org/plugins/jquery-vertical-accordion-menu/ via function that is loading different menu based on page template. What is more, I wish to ajaxify that ...
0
votes
1answer
52 views

How Can I add a menu to the theme from withen the function.php file

I have the following code I'm trying to automatically add a menu to a theme via overriding a function. So I won't have to edit the theme file However the menu is being outputted at the top of the ...
1
vote
1answer
313 views

How to remove a metabox from menu editor page?

I am not sure if it is much different for any page but I am wondering how to remove a metabox from the appearance>menu page without having to go into the wordpress core files and remove it. Is there ...
1
vote
1answer
60 views

Unregister Nav Menu with fallback?

I am trying to create a child theme so theme updates are much easier. I want to remove the parent theme menus and add my own. I know I can modify the header.php file (where these menus exist) and ...
0
votes
0answers
59 views

Wordpress adding in site URL to header links

A little information: I am developing a one page theme that uses posts as sections on the main page. I have created code that allows users to add a menu item in the post page from a meta box when they ...
0
votes
1answer
65 views

Function Reference for custom link in Admin Menu Management Page

What is the function reference for the text within the URL field in the Admin Menu page? I have a PHP function that is utilizing the_content function reference to look for specific file paths and ...
0
votes
1answer
275 views

define css class in functions.php

In my theme I use theme options to set colors to categories (heading colors, dividers colors etc etc) The way I do it is defining variables which holds a color hexa like so: $category1_color = ...
0
votes
1answer
77 views

Dynamic Menu drops pages?

I've created a Dynamic Menu that highlights the selected page and colors for example the blog page "red" while the other links (home, about, contanct) remain white. My question is how can I make the ...
2
votes
2answers
910 views

Hide main div if wp_nav_menu is empty

I want to hide the div class "navmain2" if the menu is empty. See code below: <!-- Start main navigation --> <div class="navmain2"> <div id="logo"></div> ...
1
vote
2answers
259 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?
2
votes
1answer
2k views

Add container to nav_menu sub menu

Is there a way I can wrap a div around wp_nav_menu's ul.sub-menu So for example the markup would go from <ul class="menu"> <li><a href="/">Item 1</a></li> ...
2
votes
1answer
4k views

Using wp_get_nav_menu_items() to list children of children pages

I'm working with a Genesis Based Theme and I'd like build a Page/ Child Page menu structure. That part I can do with the help of some code produced by Bill Erickson. Essentially what I'm trying to do ...
1
vote
1answer
100 views

Where do I add html code to the menu div?

When looking at header.php, I see the following line: <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> That function is defined in nav-menu-template.php and generates the ...
0
votes
1answer
110 views

Custom Menu in Admin doesn't change menu in browser

i've just begun participating these stack overflow forums yesterday and had a great experience with someone who could problem solve with me. working from the admin panel under the themes tab i have ...
1
vote
1answer
843 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, ...
0
votes
1answer
159 views

Menu not styling. New menus functionality giving me a headache

I can't find a good tutorial on the new menu handling functions, and the ones I found don't seem to work for me. What am I doing wrong? In my functions.php: (I'm using the Blank Slate theme as a ...
0
votes
3answers
2k views

Removing specific menu items?

I used the following to remove certain menus for the "editor" function remove_menus () { global $menu; if( (current_user_can('install_themes')) ) { $restricted = ...
0
votes
1answer
582 views

How do I get my nav menu to show sub pages?

http://webdesignsalemoregon.com/westernmennoniteschool/ is my website. I've got the top menu which is the one that was in the theme when I started to customize it. It's got a test drop down that ...
1
vote
1answer
4k views

Breadcrumbs showing Parent and Child Pages

We are trying to create a function for breadcrumbs that will show not only the path to the current page, but also to other pages with the same parent page. For instance, on ...
0
votes
2answers
160 views

Change div background acording to the selected category

I'm coding a graphic menu that consist in five divs with a background each. On mouseover the background changes and the child div disappears. On click, each one works like a link to the correspondent ...
0
votes
1answer
975 views

Custom Post Type & Custom Menu Walker to append custom class for active post types

I have an interesting problem I am trying to solve here regarding a custom nav menu. Essentially, I have created a custom walker class for my nav menu and I have manually added a menu entry directing ...
1
vote
1answer
169 views

Hard-coding custom menu elements for menu manager

I realize that one can add custom links through the menu manager but is there a way to manually create such components through the functions.php file? More specifically, one example here relates to a ...
0
votes
1answer
103 views

How would I make a function to dynamically determine if user is logged to change navigation menu text?

I would like to create a function to determine if a user is logged in or logged out. If the user is logged in I would like the navigation menu text to say "My Account" (this is what it currently ...
0
votes
2answers
846 views

Conditional custom menu?

I'm trying to create a custom menu that displays a <li></li> when a user is logged in, and not display it when they're not. I have this so far, but it's not working. Does anyone know how ...