Minimum Template Files for Theme Development

To have the theme listed: style.css With at minimum this: /* Theme Name: Minimum Theme Description: Test Author: Test Version: 1.0 */ For the theme to be functional: index.php index.php must have a post loop, so this would be the bare minimum functional index.php <html> <head><?php wp_head(); ?></head> <body> <?php if ( have_posts() ) { … Read more

Display Menu Name using wp_nav_menu

If you know the menu’s slug, then things are easier, otherwise you can use this function to get the menu at a specified location. <?php function wpse45700_get_menu_by_location( $location ) { if( empty($location) ) return false; $locations = get_nav_menu_locations(); if( ! isset( $locations[$location] ) ) return false; $menu_obj = get_term( $locations[$location], ‘nav_menu’ ); return $menu_obj; } … Read more