Lego2012
12/13/2016 - 3:29 PM

Display featured image above content on Posts page

Display featured image above content on Posts page

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

<!-- functions.php: -->

// Display featured image above content on Posts page
add_action ( 'genesis_after_header', 'sk_featured_image_posts_page' );
function sk_featured_image_posts_page() {
    $posts_page_featured_image = get_the_post_thumbnail( get_option( 'page_for_posts' ) );
    // $posts_page_featured_image = get_the_post_thumbnail( get_option( 'page_for_posts' ), 'large' );

    if ( is_home() && $posts_page_featured_image ) {
        echo '<div class="page-thumbnail">', $posts_page_featured_image, '</div>';
    }

}

<!-- OR -->

<!-- home.php: -->

<?php

$posts_page_featured_image = get_the_post_thumbnail( get_option( 'page_for_posts' ) );
// $posts_page_featured_image = get_the_post_thumbnail( get_option( 'page_for_posts' ), 'large' );

if ( $posts_page_featured_image ) {
    echo '<div class="page-thumbnail">', $posts_page_featured_image, '</div>';
}

genesis();