Here we will Create 3 Latest Post one after one by ‘bootstrap’.
First Post :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <div class="row"> <?php global $post; $myposts = get_posts('numberposts=1&offset=0&category='); foreach($myposts as $post) : setup_postdata($post); ?> <div class="col-md-12"> <?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'kev-feature'); ?> <img src="<?php echo $img_url[0];?>"/> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </div> <?php endforeach; ?> </div> |
Second & Third Post:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <div class="row"> <?php global $post; $myposts = get_posts('numberposts=2&offset=1&category='); foreach($myposts as $post) : setup_postdata($post); ?> <div class="col-md-6"> <?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'kev-feature'); ?> <img src="<?php echo $img_url[0];?>"/> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </div> <?php endforeach; ?> </div> |