Header snippet

This topic is: not resolved

This topic contains 12 replies, has 3 voices, and was last updated by  DavidF 1 year, 4 months ago.

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

    DavidF
    Participant
    Post count: 36

    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?

    Thanks

    David


    #43438

    Mahesh
    Participant
    Post count: 4

    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 ) );

    #43446

    braddalton
    Participant
    Post count: 10203

    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.
    [php]
    // 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 );
    [/php]

    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.


    #43513

    DavidF
    Participant
    Post count: 36

    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.


    #43558

    braddalton
    Participant
    Post count: 10203

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


    #43585

    DavidF
    Participant
    Post count: 36

    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.

    Thanks

    David


    #43588

    braddalton
    Participant
    Post count: 10203

    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:
    [php]
    if ( is_front_page () )
    or
    if ( is_home () )
    [/php]
    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.


    #43776

    DavidF
    Participant
    Post count: 36

    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=”http://127.0.0.1:4001/wordpress/wp-content/uploads/2013/06/header1.png” 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.

    Dave


    #43780

    DavidF
    Participant
    Post count: 36

    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 () ) : ?>
    hi
    <?php else : ?>
    <!—<div id=”optin2″>Join Us</div>—>
    <?php endif; ?>

     

     


    #43782

    braddalton
    Participant
    Post count: 10203

    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.


    #43785

    DavidF
    Participant
    Post count: 36

    Hi Brad,

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

    Dave


    #43790

    DavidF
    Participant
    Post count: 36

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


    #45720

    DavidF
    Participant
    Post count: 36

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

    Dave


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

You must be logged in to reply to this topic.