How to Remove Your Menu From a Specific Page
It's time for your daily dose of Wordpress Wisdom! In today's slightly advanced tutorial I'll be showing you how to add a PHP code snippet to your website that allows you to remove your main menu for a specific page!
The theme I'm using in this example is the free version of Generate Press.
You might be asking, "But Eric, why would I want to remove my menu like that?" Well I'm glad you asked! Maybe you've created an incredible and glorious landing page and you want your audience to focus all their attention on the calls to action within the landing page. This can be done using the WP Code Lite plugin to add a simple php code snippet that removes the main menu from sight. Watch the video and I'll show you how!
Here is the snippet code you'll be pasting. As shown in the video, you'll be replacing the "sample-landing-page" text below with the url slug of the page on your website that you're wanting to remove the menu from:
add_filter( 'generate_navigation_location','tu_move_navigation' );
function tu_move_navigation( $location )
{
if ( is_page( 'sample-landing-page' ) ) {
return '';
}
return $location;
}
As always, feel free to share this video to anyone needing help with this. If you have any Wordpress related questions that you'd like to see me create a tutorial for send me a private message or leave me a message on my profile.
If you want to check out all my Wordpress Wisdom tutorials feel free to head over to my blog.
Be productive!
Get your hands dirty!
Create that content!
Become the master of Wordpress you know you can be!
Join FREE & Launch Your Business!
Exclusive Bonus - Offer Ends at Midnight Today
00
Hours
:
00
Minutes
:
00
Seconds
2,000 AI Credits Worth $10 USD
Build a Logo + Website That Attracts Customers
400 Credits
Discover Hot Niches with AI Market Research
100 Credits
Create SEO Content That Ranks & Converts
800 Credits
Find Affiliate Offers Up to $500/Sale
10 Credits
Access a Community of 2.9M+ Members
Recent Comments
14
No need for too many plugins. The WP code light plugin is a very lightweight seamless plugin with many uses. Using it correctly wonβt slow down your site at all. πππΌπ―
Be aware that the more you play with your website by consistently making changes, the more you prevent it from ranking.
Not true at all. ππΌ
Customizations to your website donβt affect your ranking unless you were to do something that drastically affected loading times and brought down the user experience.
See more comments
Join FREE & Launch Your Business!
Exclusive Bonus - Offer Ends at Midnight Today
00
Hours
:
00
Minutes
:
00
Seconds
2,000 AI Credits Worth $10 USD
Build a Logo + Website That Attracts Customers
400 Credits
Discover Hot Niches with AI Market Research
100 Credits
Create SEO Content That Ranks & Converts
800 Credits
Find Affiliate Offers Up to $500/Sale
10 Credits
Access a Community of 2.9M+ Members
Excellent stuff as always Bro! Not sure I will use it personally, but... if I ever decide I need to, I know where to come!
ππ
Just more ways to show the customizability of what so many feel is a "blah" theme. It's actually one of the best. π―
Absolutely is Eric, but... my preferred theme at the moment is Kadence, and have you ever heard about "Vertice"???
ππ
I've seen them, but never used them. Vertice looks kinda cool, I opened it up in an expert class I did on choosing a theme, but now when I actually get into a theme I prefer it to be bare bones so I can model it how I want it.
That's the first time I heard about it buddy!!
It was part of your mastering wordpress 2024 series I believe!
ππ