Just like other elements / sections, we can also remove Primary Navigation menu from specific pages or posts as per requirement. For example while creating corporate type of website using Genesis theme, you may not want to show primary menu on specific pages.

Code to remove Primary Menu from specific pages in Genesis

Paste following code in functions.php file to remove primary menu from displaying on those specific pages.

https://gist.github.com/53ea6290509766bf6187

In the code, 61 and 181 are IDs of pages we want to hide. Replace them with ID of pages on your website. You can also add more pages in this list.

Removing Primary Menu from only homepage in Genesis

Based on the above code, we can hide Primary menu from only homepage and show it on the rest pages / posts. Paste following code in functions.php file.

https://gist.github.com/c5e57167e31d1dace0e7

As such, you can play around with code to hide Primary and Secondary menu on any post, page, homepage of your Genesis theme website.

Davinder Singh Kainth

A digital creator with 15+ years of experience in Website Design, Development, SEO, and Content Creation to Podcasting at SmartWebCreators.com with the motto of "Be Smart, Keep Creating". A coach, consultant, and your dear geek friend ❖

1 Comment

  1. Agnes on April 8, 2015 at 10:28 pm

    Hello,

    I used the above code and it works perfectly. Thank you!

    I need help with using the above code but with a range of pages. I have about 60 pages I want to hide the primary menu. The page IDs range from 1004 to 1176.

    Instead of entering each ID separately, how do I enter a range.

    Thanks!

Leave a Comment