Custom loop for latest images
-
I need to create a custom loop that grabs like the 10 latest images from subfolders.
I’ve played a little with the shortcode code but my skills are limited.
For now i have this loop which grabs the featured image of all subfolders:
<?php $args = array ( 'post_type' => 'galleryfolder', 'posts_per_page' => -1, 'post_parent' => $post->ID ); $children = new WP_Query($args); if($children->have_posts()){ while($children->have_posts()){ $children->the_post();?> <?php the_post_thumbnail();?> <?php } wp_reset_postdata(); } ?>
Any help on how to make it grab the latest 10 gallery images of all subfolders?
Thanks
- The topic ‘Custom loop for latest images’ is closed to new replies.