/**
* Add a home link to your menu
*
* @since 4.0
*/
function wpex_add_menu_home_link( $items, $args ) {
// Only used for the main menu
if ( ‘main’ != $args->theme_location ) {
return $items;
}
// Create home link
$home_link = ‘
‘;
// Add home link to the menu items
$items = $home_link . $items;
// Return menu items
return $items;
}
add_filter( ‘wp_nav_menu_items’, ‘wpex_add_menu_home_link’, 10, 2 );