Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $featuredPosts = new WP_Query( array(
- 'post_type' => array( 'post','collective_slideshow' ),
- 'posts_per_page' => 10,
- 'orderby' => 'rand'
- ));
- ?>
- <?php while($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
- <?php $args = array(
- 'post_type' => 'attachment',
- 'numberposts' => 1,
- 'post_status' => null,
- 'post_parent' => $post->ID,
- );
- $attachments = get_posts($args);
- foreach ($attachments AS $attachment) {
- $imgid = $attachment->ID;
- $meta = wp_get_attachment_metadata($imgid);
- $imgw = $meta['sizes']['collective-slide']['width'];
- if ($imgw == "870") {?>
- <div class="slide">
- <div class="slideshow title">
- <h2><?php echo get_the_title($post->post_parent); ?></h2>
- </div><!-- .title -->
- <div class="image">
- <?php echo the_post_thumbnail('collective-slide'); ?>
- </div><!-- .image -->
- </div><!-- .slide -->
- <?php
- }
- }
- ?>
- <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement