• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Different Nav Menu On Front Page

This code enables you to display a different menu on your front page.

The code is written to change the primary menu on the front page however you can change the is_front_page() conditional tag to any other.

It works in any theme and should be placed at the end of your child theme functions.php file.

Register for full access


You will need to create 2 menus:

  1. One menu named primary
  2. And one named front

1. primary menu

Here’s the settings you need to use for the menu named primary:

primary menu

Under the Menu Settings > Theme locations, check the box to assign the menu to the Primary Navigation Menu location.

2. front menu

Here’s the settings you need to use for the menu named front:

front page menu

Under the Menu Settings > Theme locations, uncheck the box to assign the menu to the Primary Navigation Menu location.

Conclusion

So to wrap up, the Menu Settings > Theme Locations settings should be checked for the primary menu which displays on all pages excluding the front page.

And the Menu Settings > Theme Locations settings for the front menu should be unchecked as the code controls the setting for this menu so it only displays on the front page.

This is one solution which enables you to remove the default primary nav menu from your front page and show a custom menu instead without removing the primary menu from the rest of your site.

Nav Menu

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems