do_action appearing outside of menu?

I think the reason is echo vs return: The function posts_logout_link from http://plugins.svn.wordpress.org/logout-password-protected-posts/trunk/logout.php is using echo. Your code is therefore both returning and echoing values. ps: You could consider using output buffering to fix this ob_start(); do_action(‘posts_logout_link’); $logout_link=ob_get_clean(); return $menu . ‘<li>’ . $logout_link . ‘</li>’; or modify the plugin code functions to your needs … Read more

Grey out nav buttons unless is_user_logged_in()

When you look at the possible arguments, then you’ll see that there’s as well the option to add a custom nav menu walker class. $defaults = array( ‘theme_location’ => ”, ‘menu’ => ”, ‘container’ => ‘div’, ‘container_class’ => ”, ‘container_id’ => ”, ‘menu_class’ => ‘menu’, ‘menu_id’ => ”, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ … Read more

Possible Menu Hack?

You are serving the Official Artwork page from cache. Check the bottom of the source: <!– Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Page Caching using disk: enhanced Database Caching using disk: basic Object Caching 1745/1914 objects using disk: basic Served from: www.arrangedrecords.com @ 2013-01-21 17:41:23 –> Did you really disable all plugins?

SlideDeck 2, make back-end visible for admins only

Put the following in your functions.php: if (is_admin() && ! current_user_can(‘install_plugins’)) { add_action(‘admin_init’, ‘remove_slidedeck_menu_page’); add_action(‘admin_footer’, ‘remove_slidedeck_media_button’); } // remove the menu page function remove_slidedeck_menu_page() { remove_menu_page(‘slidedeck2-lite.php’); } // remove the button function remove_slidedeck_media_button() { echo <<<JQUERY <script> jQuery(document).ready(function($) { $(‘#add_slidedeck’).remove(); }); </script> JQUERY; } Note: I did test this. If something doesn’t work for you, … Read more

Add CSS to head depending on nav menu walker

Call wp_nav_menu() before wp_head() is called, and store the result for later usage: <head> <?php $menu = wp_nav_menu( array( ‘echo’ => FALSE, ‘theme_location’ => ‘primary’, ‘walker’ => new Special_Walker ) ); wp_head(); ?> </head> <body> <?php echo $menu; Now you can enqueue the CSS from your custom walker. In your walker collect all CSS rules … Read more

Add within the output of

Use the arguments before and after: wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’, ‘before’ => ‘<span>’, ‘after’ => ‘</span>’ ) ); To see how these arguments are used, look at the method start_el() in Walker_Nav_Menu: $item_output = $args->before; // ‘before’ $item_output .= ‘<a’. $attributes .’>’; $item_output .= $args->link_before . apply_filters( ‘the_title’, $item->title, $item->ID ) … Read more

How do you return a menu with the menu name?

If you want to return the output of wp_nav_menu(), instead of echo-ing it, you should replace ‘echo’ => 1, with ‘echo’ => 0, Then you should get something out of var_dump( $menu );. You can read more about the input parameters in the Codex. Update: You should remove this line: ‘items_wrap’ => ”, to use … Read more

Highlight wp_nav_menu when category is selected

one solution to your problem using jQuery( put this code in functions.php ) <?php add_action(‘wp_footer’,’ravs_browse_menu’); function ravs_browse_menu(){ if(isset($_GET[‘cat’]) && $_GET[‘cat’] !=”){ ?> <script> jQuery(document).ready(function(){ jQuery(‘#menu-item-299’).addClass(‘current-menu-item’); }); </script> <?php } } ?>