Thread: PHP question
View Single Post
Old 07-01-2013, 10:12 PM  
vdbucks
Monger Cash
 
Industry Role:
Join Date: Jul 2010
Posts: 2,773
Quote:
Originally Posted by BCyber View Post
I did try your example about but all the posts/thumbs disappeared so I don't know what the problem is.
Try changing "$all_photo_arr = get_posts( $args );" to "$all_photo_arr = new WP_Query($args);"

The following works as intended for me:

Code:
$args  = array(
                      'post_type' => 'post', 
                      'meta_key' => '_thumbnail_id', 
                      'posts_per_page' => 50,
                      'paged' => $paged
                     );
$all_photo_arr = new WP_Query($args);

if ( $all_photo_arr->have_posts() ) :
  while ( $all_photo_arr->have_posts() ) : $all_photo_arr->the_post();
    the_post_thumbnail();
  endwhile;
endif;
vdbucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote