Skip to content

Instantly share code, notes, and snippets.

@wpsmithtwc
Created July 24, 2017 17:25
Show Gist options
  • Save wpsmithtwc/0384884881e9bc373fbcd4756b370bd4 to your computer and use it in GitHub Desktop.
Save wpsmithtwc/0384884881e9bc373fbcd4756b370bd4 to your computer and use it in GitHub Desktop.
Add menu with custom widget location
<?php
add_filter( 'wp_nav_menu_args', 'my_add_menu_descriptions' );
function my_add_menu_descriptions( $args ) {
if ( $args['theme_location'] != 'primary' && $args['theme_location'] != 'secondary' ) {
$args['walker'] = new Menu_With_Description;
$args['desc_depth'] = 0;
$args['thumbnail'] = true;
$args['thumbnail_link'] = false;
$args['thumbnail_size'] = 'nav_thumb';
$args['thumbnail_attr'] = array( 'class' => 'nav_thumb my_thumb', 'alt' => 'test', 'title' => 'test' );
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment