[wp-trac] [WordPress Trac] #37697: Strange behavior with thumbnails on preview in 4.6

WordPress Trac noreply at wordpress.org
Wed Aug 17 21:36:50 UTC 2016


#37697: Strange behavior with thumbnails on preview in 4.6
-----------------------------+------------------------
 Reporter:  jbenton          |       Owner:  joemcgill
     Type:  defect (bug)     |      Status:  accepted
 Priority:  high             |   Milestone:  4.6.1
Component:  Post Thumbnails  |     Version:  4.6
 Severity:  normal           |  Resolution:
 Keywords:  needs-testing    |     Focuses:
-----------------------------+------------------------

Comment (by joemcgill):

 For those wanting to test this issue, you'll need to add something like
 the below code after the main loop on a custom page template and then
 preview a page using that template.

 {{{#!php
 <?php
 $test_args = array(
         'post_type'  => 'post',
         'posts_per_page' => 4,
         'meta_query' => array(
                 array(
                         'key' => '_thumbnail_id',
                         'compare' => 'EXISTS'
                 ),
         ),
         'ignore_sticky_posts' => true,
 );

 $stories = new WP_Query( $test_args );

 while ( $stories->have_posts() ) {
         $stories->the_post();
         if ( has_post_thumbnail() ) {
                 the_post_thumbnail();
         }
 }

 wp_reset_postdata();
 ?>
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37697#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list