Function to add a HOME link to your primary navigation
This function creates a custom link in your primary navigation. You can modify it and add more links or insert any other html to your menus
/** * Snippet Name: Function to add a HOME link to your primary navigation * Snippet URL: https://wpcustoms.net/snippets/add-home-link-primary-navigation/ */ function addHomeMenuLink($menuItems, $args) { // change "primary_menu" to your theme's menu name if('primary_menu' == $args->theme_location) { if ( is_front_page() ) $class = 'class="current-menu-item"'; else $class = ''; $homeMenuItem = '