Support » Themes and Templates » header to show on home page only -Twenty Twelve

  • Resolved chrislenoski

    (@chrislenoski)


    I need to have the header image on the home page only (home page is set to latest posts). I’ve figured out how to exclude it from a page but how can I have to only show on the home page so I don’t have to exclude it from every new page I make?

Viewing 7 replies - 1 through 7 (of 7 total)
  • you could edit header.php in the child theme, and add a new condition, to check for the homepage, into the existing conditional statement of the header image section;
    http://codex.wordpress.org/Conditional_Tags

    existing line:

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

    after the edit:

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

    Thread Starter chrislenoski

    (@chrislenoski)

    Thanks! That works great! How can I do it with this additonal menu too?

    <!– Lower Navigation –>
    <nav id=”lower-navigation” class=”main2-navigation” role=”navigation”>
    <h3 class=”menu-toggle”><?php _e( ‘Lower Menu’, ‘twentytwelve’ ); ?></h3>
    <div class=”skip-link assistive-text”>“><?php _e( ‘Skip to content’, ‘twentytwelve’ ); ?></div>
    <?php wp_nav_menu( array( ‘theme_location’ => ‘secondary’, ‘menu_class’ => ‘nav-menu’, ‘fallback_cb’ => false ) ); ?>
    </nav><!– #lower-navigation –>

    general for anything to show only on the home page (posts page):

    <?php if( is_home() ) : ?>
    
    whatever to show on home page only
    
    <?php endif; ?>
    Thread Starter chrislenoski

    (@chrislenoski)

    Thanks so much!

    alchymith: Beginner here:

    Editing header.php to reflect

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

    removed header image from all pages.

    Q1: How can I bring back the header image for the Front Page (static)?

    Q2: How can I Title and Tagline remove from *all* pages except for Front Page (static)?

    Thanks!

    Peter

    existing line:

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

    after the edit:

    if ( ! empty( $header_image ) && is_home() ) : ?>
    ——————————————————–
    This is really useful but im customized my header to using a slider plugin. its like this:

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

    so what should i change it to? please help ! alchymyth

    @hoahonggiay – you need to start a new thread – this one is marked resolved and outdated. You can do so here:

    http://wordpress.org/support/forum/themes-and-templates#postform

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘header to show on home page only -Twenty Twelve’ is closed to new replies.