Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $loop = new WP_Query(array('post_type' => 'post', 'order' => 'DESC', 'category_name' => 'blog', 'posts_per_page' => 2)); ?>
- <?php while($loop->have_posts()) : $loop -> the_post(); ?>
- <div class="col-sm-6">
- <article>
- <a href="<?php the_permalink(); ?>">
- <?php if ( has_post_thumbnail() ) {
- the_post_thumbnail('blog_img', array('class' => 'img-responsive'));
- } else { ?>
- <img src="<?php bloginfo('template_directory'); ?>/img/blog1.png" alt="<?php the_title(); ?>" />
- <?php } ?>
- </a>
- <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
- <div class="post-details">
- <i class="fa fa-user"></i> <?php the_author(); ?>
- <i class="fa fa-clock-o"></i> <time><?php the_date(); ?></time>
- </div> <!-- end of post details -->
- <div class="blog-summary text-justify">
- <?php the_excerpt(); ?>
- </div>
- </article>
- </div>
- <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement