Community Forums › Forums › Archived Forums › General Discussion › How to add custom-sized header to landing page
Tagged: landing page, landing page header
- This topic has 8 replies, 3 voices, and was last updated 10 years, 3 months ago by ZAAAX.
-
AuthorPosts
-
May 12, 2014 at 6:58 am #104632howtofeelhappierMember
Hi,
I've been round-and-round in circles and have read loads of the posts here, but I can't find out how to do this!I want to add a header to a landing page, which is a different size to my site's usual header (so from what I can see a plugin won't work?).
Here's the URL of my Work-In-Progress:
What I want is to create a header image between the two menus.
I would also like the top menu to be right-aligned.
Can anyone help please?
I am using Crystal (with no landing page, so have adapted the one from Outreach_pro)
Thank you so much!
Namaste,
ClareHere's my landing page file:
<?php
/**
* This is adapted from the landing page for the outreach pro theme.
*
* @author StudioPress
* @package Outreach Pro
* @subpackage Customizations
*//*
Template Name: Gratitude Inner Circle All Pages
*/// Add custom body class to the head
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
$classes[] = 'gratitude';
return $classes;
}//* Force full width content layout
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );//* Remove site header elements
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header', 10 );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
remove_action( 'genesis_before_header', 'utility_bar' );//remove nav - uncomment these to remove the original menu (if needed)
remove_action( 'genesis_before_header', 'genesis_do_nav' );
remove_action( 'genesis_after_header', 'genesis_do_subnav' );//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );// Add new navbar
add_action('genesis_before_header', 'customnavgratitudetop' );
function customnavgratitudetop() {
require(CHILD_DIR.'/customnavgratitudetop.php');
}// Add new navbar
add_action('genesis_after_header', 'customnavgratitude' );
function customnavgratitude() {
require(CHILD_DIR.'/customnavgratitude.php');
}//* Run the Genesis loop
http://www.clarejosa.com/gratitude-inner-circle/temp/
genesis();May 12, 2014 at 7:28 am #104635Brad DaltonParticipant1. You could hook it in conditionally from your child themes functions file using the
is_page_template('page_landing.php')
conditional tag
Or
2. Hard code it into your landing page template.
In both cases, you would need to remove the default.
3. Or you could use CSS code to add it and remove the default using a remove_action conditionally or in your file.
Did this for a client last week and simply used PHP code from the functions file.
May 12, 2014 at 8:29 am #104650howtofeelhappierMemberHi Brad,
Thanks for getting back to me on this one.
As far as I can tell, I have done the 'remove' bit in the code above.Where I'm stuck is how to tell my website to use a different header image for that one page. I'm happy to do it in the landing page's code - I'm just looking for the snippet to do it and I have spent hours this morning looking for it.
To be honest, I'd expect it to be such a common thing to want to do that I was surprised I couldn't find the answer on the forum 🙂
The 'hard-coding in the landing page template' is my favourite option - is there a snippet or tutorial out there that could help?
I'm super-keen to learn how to do this - and I'm sure it will help other StudioPress users.
Thanks everyone!
Namaste,
ClareMay 12, 2014 at 9:03 am #104652Brad DaltonParticipantThere's several on my site which include different ways to get what you need.
May 12, 2014 at 9:20 am #104660howtofeelhappierMemberHi Brad,
I have used a combo ofAdd Unique Header Image To Custom Landing Page Template for Genesis
andHowever, my below-header menu is showing in the middle of the header image (it seems to still be taking its header-height instruction from the main website's css - even though I have removed this header).
I'm not trying to be stupid, but I'm still going round in circles and I'm not an expert but far from a newbie. So I am definitely trying to help myself, not sponging off the forums 🙂
Is there anyone who can spot what I have done wrong?
Thanks!
ClareMay 12, 2014 at 9:32 am #104662Brad DaltonParticipantNo need to use both,
Just use the first solution.
Please link to your live landing page.
Can't troubleshoot problems unless can see the code.
May 12, 2014 at 11:04 am #104682howtofeelhappierMemberHere's my landing page - http://www.clarejosa.com/gratitude-inner-circle/temp/ - it's now working - but I have now lost the header image for my home page... http://www.clarejosa.com
Thanks Brad. 🙂
May 12, 2014 at 12:50 pm #104703howtofeelhappierMemberWoo hoo! Got them both working now - not entirely sure how, but it's working.
Thank you for your tutorials, Brad.
I know where to look next time I'm accidentally tempted to use Google instead 🙂October 9, 2014 at 8:04 pm #127302ZAAAXMemberGreat help Brad & howtofeelhappier, easy to find, thanks for this.
I do have one little question tho. I want the header complete to show above the landing page content, which I can do by creating a custom landing page, uploading it, which I've done, and deleting the ....
//* Remove site header elements
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );from the code call, therefore adding the header into the custom landing page, sweeet.
I wanted to have the header logo image NOT clickable tho, and I was wondering how to do this ... hope I make sense.
Crisp!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.