Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="related_posts">
- <?php
- $my_query = new WP_Query('orderby=rand&numberposts=4');
- while ($my_query->have_posts()) : $my_query->the_post();
- $do_not_duplicate = $post->ID;
- $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' );
- $thumbnail = get_the_post_thumbnail($post->ID,'thumbnail');
- ?>
- <a style="background: url(<?php echo $src[0]; ?> ) !important; background-size: cover !important;" class="post" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><span><?php the_title(); ?></span></a>
- <?php endwhile; wp_reset_postdata(); // End the loop ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement