Add a class at specific element in custom Menu Walker

Count the level 0 elements in a static variable in the method and add an extra class if you hit the third. Sample code, not tested: function start_lvl(&$output, $depth) { static $column = 1; $indent = str_repeat(“\t”, $depth); if ($depth > 0) { $output .= “\n$indent<ul class=”subsubmenu”>\n”; } else { $column += 1; $extra = … Read more

How to rewrite the output of wordpress nav menu?

You could either try a custom walker as suggested above, or try to work it out via the number of invaluable arguments for the wp_nav_menu function. There are several parameters that you can use in order to change the container, list item ot entry classes, ids or even HTML tags. See if that would cause … Read more

Unable to create or edit menus

I have my memory limit set at 128MB in php.ini and wp-config.php. There is an implicit minimum requirement for the WP Admin to be able to use 256M. Try setting your PHP memory limit to 256M instead of 128M. Also, be sure you have WP_DEBUG set to true in wp-config.php: define( ‘WP_DEBUG’, true ); Which … Read more

Appending a GET-Variable to wp_nav_menu

Filter ‘wp_nav_menu_objects’. You get an array as argument, a list of all items. Pseudo-code, not tested: add_filter( ‘wp_nav_menu_objects’, ‘wpse_76401_filter’ ); function wpse_76401_filter( $items ) { $out = array(); foreach ( $items as $item ) { if ( isset ( $item->url ) ) $item->url = add_query_arg( ‘variable’, ‘123’, $item->url ) $out[] = $item; } return $out; … Read more

How can I Add a variable PHP in the Menu Nav

You should never need a plugin to insert raw PHP code somewhere. There are always side effects you cannot see or fix easily. Filter wp_nav_menu_objects instead, and add the parameter here to the URLs. if ( ! empty ( $_GET[‘partenaire’] ) ) add_filter( ‘wp_nav_menu_objects’, ‘wpse_82194_add_param’ ); /** * Add a parameter to item URLs. * … Read more

WordPress 3.5 dropdown menu

For the moment based on your question I am assuming you want a single menu, which when hovering over a menu item, its child items are displayed in a drop down menu. Following this tutorial should give you a horizontal menu with vertical drop downs: http://codex.wordpress.org/Creating_Horizontal_Menus Repeat for each menu you need. For more on … Read more

How to insert link to the default post archive into a menu

If you don’t have static front page Since you can add a custom post type archive, then just specify post_type=post. If you have static front page Go to Settings -> Reading and specify posts page you’ve created as Posts page from dropdown. Now all necessary classes will be added to Nav Menu — current-menu-item, current-menu-parent, … Read more