Support » Alpha/Beta/RC » A possible issue with has_post_thumbnail()

  • Resolved OllieMcCarthy


    Hi, congrats on the cool new features of WP 3.6! I love the new post formats UI 🙂

    I’m just testing out my themes and I have this code that checks for thumbnail and displays a default image if no featured image is set in the post:

    if (has_post_thumbnail()) {
    the_post_thumbnail('half-landscape', array('class' => 'image-resize'));
    } else {
    echo('<img src="'.get_template_directory_uri().'/images/no-image-half-landscape.png" class="image-resize" alt="no thumbnail available" />');

    New standard posts seem fine but a couple of older posts don’t process the else part of the code above. It isn’t a case of broken images – all the img markup is missing. I’m not sure what to make of it.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘A possible issue with has_post_thumbnail()’ is closed to new replies.