header to show on the home page only -Twenty Twelve (customized header) (7 posts)

  1. hoahonggiay
    Posted 1 year ago #

    So i think this is really easy to do to make the header only show in the home page.
    existing line:

    if ( ! empty( $header_image ) ) : ?>

    after the edit:

    if ( ! empty( $header_image ) && is_home() ) : ?>

    I customized my header and using a slider plugin. its like this:

    <?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>

    so what should i change it to? please help !

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    Replace this 4 lines block #L48 to #L51 (link for reference)


    <div class="myslider">
    	<?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>

    The div is optional, might not needed.

    In case, your front page is set to a page. There is no need to edit any template at all, just place the shortcode at the topmost area of that page content.

  3. sharadchhetri
    Posted 1 year ago #

    Check if the plugin is providing the shortcode.
    I implemented the short code in my blog also.
    I have written about this How To.

    For live example.You can see my home page of my blog,I am still using it

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #


    <?php if ( function_exists( 'meteor_slideshow' ) && is_home() ) { meteor_slideshow(); } ?>

    if this doea not work, please post the full code of header.php (please use the pastebin as described in http://codex.wordpress.org/Forum_Welcome#Posting_Code )

  5. hoahonggiay
    Posted 1 year ago #

    Thank you all. so helpful my heroes :)
    @paulwpxp: so i remove the whole header (which the code from #L48 to #L51 ) and after that copy the code of the Slider plugin to the Home page (i set a static home page from a page).
    @alchymyth: i did try your solution first and it didnt work. but I'm quite curious how to fix this in the header.php so i would like to put my full header code here:
    @sharadchhetri: im really new with coding..im not sure i understand your solution. Thank so much tho

  6. alchymyth
    Forum Moderator
    Posted 1 year ago #

    are you using a static front page?

    in this case, use is_front_page() instead of is_home();

    <?php if ( function_exists( 'meteor_slideshow' ) && is_front_page() ) { meteor_slideshow(); } ?>


  7. hoahonggiay
    Posted 1 year ago #

    Thanks alchymyth so much...

Topic Closed

This topic has been closed to new replies.

About this Topic