[wp-trac] [WordPress Trac] #39302: Twenty Seventeen: Featured image not displayed on single template

WordPress Trac noreply at wordpress.org
Fri Dec 16 04:37:12 UTC 2016


#39302: Twenty Seventeen: Featured image not displayed on single template
---------------------------+-------------------
 Reporter:  westonruter    |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  4.7.1
Component:  Bundled Theme  |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-------------------
 I assigned a featured image to a post and it appeared as expected in the
 loop. When I navigated to a given post that had the featured image,
 however, it was nowhere to be seen. In looking further, the call to
 display the featured image is in `header.php` before `the_post()` is
 called and thus the `$post` global is not set. This means that
 `has_post_thumbnail()` return false and no featured image will be set. To
 reliably get the featured image, we need to explicitly pass in
 `get_queried_object_id()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39302>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list