Header snippet

This topic is: not resolved

This topic contains 12 replies, has 3 voices, and was last updated by  DavidF 2 years, 5 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #43436


    Hi All,

    I want to add a header to a Premise landing page.

    Does anyone know the correct header snippet I should add to my custom code?





    Taken from genesis code snippets. Brian also has code snippets.

    /** Add support for custom header */
    add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 100 ) );



    If you want all landing pages to use a header, you can simply remove this coce from the landing page template in your child theme.

    // Remove header, navigation, breadcrumbs, footer widgets, footer 
    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 );

    Or you can copy the existing landing page, rename it and rename the file name and remove the above code so you can then choose from 2 landing pages to use.

    One with a header and one without.



    Thanks for these post but I couldn’t get them working.

    What I want to do is just add a header or a div to my “landing” page only.

    I tried using simple hooks but it applies the my code on all pages even when using code to show on the home page it seems to not tak that rule when premise landing page is set as the home page.

    Thanks for any help.



    Which theme are you using David? Link to your site please.



    I’m using Epik theme for the blog but Premise landing page is the static home page.

    Premise has a custom function option to insert code for this reason but their support didn’t help first time around. I might go back to them.





    I tested this code David and it works:

    You will need to grab the page i.d from the source code and replace the 007 in the code with your own.

    Another option is to replace the conditional tag with:

    if ( is_front_page () )
    if ( is_home () )

    Code not displaying? Grab it on Github.

    You can then insert your header image in a new post draft and grab the HTML for the image which needs to be replaced in between the div tags.

    You can style the header using the new class and also use the advanced image settings to style the image.

    You could even add the header image using CSS code.



    Thanks Brad.

    It’s not working, I tried all option of post id home and front page. I have this in my Premise custom functions area:


    <?php function add_header_specific_page() {
    if(is_page(750) )
    echo ‘<img class=”aligncenter size-full wp-image-32533″ alt=”header” src=”” width=”700″ height=”69″ />';
    * @author Brad Dalton – WP Sites
    * @learn more http://wpsites.net
    add_action(‘genesis_header’, ‘add_header_specific_page’);


    Even viewing the source I don’t see the image inserted. So to clarify I’m adding just a header to Premise┬álanding┬ápage 750 and leave all other stuff in place. I’ll ask Premise support as well.




    Even using the simple hooks plugin and the following code doesn’t load for a Premise page.

    Tried front page, home page and page Id

    <?php if( is_front_page () ) : ?>
    <?php else : ?>
    <!—<div id=”optin2″>Join Us</div>—>
    <?php endif; ?>





    Hello David

    Sorry to hear you are having problems.

    Please link to your site and i’ll check your home page for you.

    The code I provided and tested is different to the code you embedded above.

    Please copy and paste the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.

    The code will not work if you modify it by adding PHP tags or by pasting it into the Simple Hooks plugin.

    The only changes should be made for the page i.d

    You will need to use the correct page i.d for your home page in order for the code to work.



    Hi Brad,

    The child theme functions don’t come into play with Premise. Premise has it’s own custom function area.




    I’ve contacted Premise support and explained the issue. See if they can help. Thanks for your time Brad.



    Just an update. Premise is a little limited for what I was trying to do. Thanks for all you help!


Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.