Archived topic
Remove navigation on landing pages
3 replies · Started by Jeffery on July 18, 2020
Hi guys,
Thanks for the great template. I have searched a little in the forum but couldn't find an exact way of doing what I want. So what I am trying to do is, I have a landing page for Google Ads and Facebook Ads. For these landing pages, I would like to remove the navigation but keep the "Logo" part of the navigation (but disable the hyperlink for the logo as well).
I am trying to prevent people from getting distracted and navigating around when I want them to complete a form. Is there an easy way of doing this without css? I am able to do the css thing because I am quite tech savvy, but I am afraid my other colleagues are not. I have submitted the URL of the landing page as an example.
Hi there,
You can disable the primary navigation using the disable element metabox:
https://docs.generatepress.com/article/disable-elements-overview/
To remove the logo link, you would need this filter with a conditional tag:
https://docs.generatepress.com/article/generate_logo_href/
https://codex.wordpress.org/Conditional_Tags#The_Front_Page
Alright! Thanks for your help Leo. The Code Snippet plugin is really handy. In case anyone is trying to disable the logo link as well, here is the code I use:
add_action('get_header', function() {
if ( is_page(YOUR_PAGE_ID_HERE) ) {
add_filter( 'generate_logo_href', function() {
return "";
} );
}
});
No problem :)