• Resolved olololox

    (@olololox)


    Hello all,

    I’ve been working on a theme where the featured image from the latest post appeared above the post on the front page. I then updated my front page to a static page (same code exactly), and now the featured image isn’t showing – but the placeholderhead.jpg is showing. I’d like to get the featured image working again.

    Here’s the code in question:

    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
    $image = $image[0]; ?>
    <?php else :
    $image = get_bloginfo( 'stylesheet_directory') . '/assets/img/placeholderhead.jpg'; ?>
    <?php endif; ?>
    ...
    <?php echo $image; ?>

    I’d like to be able to show the latest post featured image again… but I’m not sure what I did to make it stop working.

    Please help!

Viewing 1 replies (of 1 total)
  • Thread Starter olololox

    (@olololox)

    I’m fairly sure it has something to do with get_option('page_for_posts') but I’m not sure where to place this.

Viewing 1 replies (of 1 total)
  • The topic ‘Featured Image Stopped Working when Front Page Set to Static’ is closed to new replies.