Community Forums › Forums › Archived Forums › General Discussion › How Do I Remove The Navigation From My Landingpage?
- This topic has 8 replies, 2 voices, and was last updated 9 years, 1 month ago by jimmyc.
-
AuthorPosts
-
March 7, 2015 at 11:31 am #143589jimmycMember
Hi,
How Do I Remove The Navigation From My Landingpage + remove the link behind the logo (that points to the homepage).
I use the old eleven40 theme: http://www.succesindeliefde.nl
Cheers,
JimMarch 7, 2015 at 11:52 am #143593WhiteleyDesignsMemberA simple CSS solution for the navigation would be this:
.home #header .widget_nav_menu { display: none; }
A better way would be to go into the template that controls the navigation and wrap it in something like this (in a child theme of course) so it doesn't even load the menu (slightly better for performance but not a big difference:
<?php if( !is_home() && !is_front_page() ) : ?> put your navigation stuff here <?php endif; ?>
You could use a similar method of wrapping the anchor tag in the if statement to remove the link from the main logo - but it is probably un-necessary...leaving the link there doesn't hurt anything really.
Sorry I don't know the exact template files for the theme you are using or I would be more specific.
Matt Whiteley – WhiteleyDesigns, GitHub
Designing, Developing & Creating with WordPressMarch 7, 2015 at 11:55 am #143594jimmycMemberHi,
Thank you for your respons.
There is a seperate landingpage file with it's own code.
This is what i need:
1. the looks of the landingpage should remain the same (meaning the black bar and red logo).
2. The logo must NOT be clickable
3. The menu should be not visible.Now it looks like this: http://www.succesindeliefde.nl/inbox/
This code is in my landingpage:
<?php
/*
Template Name: Landing
*/// Add custom body class to the head
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
$classes[] = 'custom-landing';
return $classes;
}// Remove header, navigation, breadcrumbs, footer widgets, footer
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
remove_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );genesis();
March 7, 2015 at 12:12 pm #143596WhiteleyDesignsMemberThis would remove the navigation on the page (add to your CSS):
.page-template-page_landing-php ul#menu-primary { display: none; }
I gotta run now but can get back to you later about removing the link from the logo.
Matt Whiteley – WhiteleyDesigns, GitHub
Designing, Developing & Creating with WordPressMarch 7, 2015 at 12:15 pm #143598jimmycMemberHello Whiteley,
That worked great!
Oh that would be awesome.
Could you also share with me then how i can get the logo to be centered instead of aligned left (on the landingpage).
Have a great day!
Cheers,
JimMarch 7, 2015 at 3:05 pm #143606WhiteleyDesignsMemberTo center the logo on the landing page add this to your CSS:
.page-template-page_landing-php #title-area { width: 100%; text-align: center; }
The simplest way to stop the link from working on the landing page would probably be to add this to your landing page template:
<script> jQuery(document).ready(function() { jQuery('.page-template-page_landing-php #title a').click(function(e) { e.preventDefault(); }); }); </script>
So your new landing page template code would look like this:
<?php /* Template Name: Landing */ // Add custom body class to the head add_filter( 'body_class', 'add_body_class' ); function add_body_class( $classes ) { $classes[] = 'custom-landing'; return $classes; } // Remove header, navigation, breadcrumbs, footer widgets, footer add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); remove_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' ); remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs'); remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' ); remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 ); remove_action( 'genesis_footer', 'genesis_do_footer' ); remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 ); genesis(); ?> <script> jQuery(document).ready(function() { jQuery('.page-template-page_landing-php #title a').click(function(e) { e.preventDefault(); }); }); </script>
Matt Whiteley – WhiteleyDesigns, GitHub
Designing, Developing & Creating with WordPressMarch 7, 2015 at 11:44 pm #143633jimmycMemberHi,
Thank you. That worked great!
Is there also any way to make sure the title of the page is centered (on the landingpage)?
Because now it looks like this: http://www.succesindeliefde.nl/inbox/
Would be awesome.
Cheers,
JimMarch 8, 2015 at 8:10 am #143661WhiteleyDesignsMember.page-template-page_landing-php h1.entry-title { text-align: center; }
Matt Whiteley – WhiteleyDesigns, GitHub
Designing, Developing & Creating with WordPressMarch 9, 2015 at 5:11 am #143763jimmycMemberHi,
Thank you so much.
That helped.
Cheers,
Jim -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.