Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. <?php query_posts('cat=2 && showposts=3');
  2. if (have_posts()) : while (have_posts()) : the_post(); ?>
  3. <div class="col-xs-12 col-sm-4">
  4. <div class="column">
  5. <div class="news-article">
  6. <p class="news-date"><?php the_time( get_option( 'date_format' ) ); ?></p>
  7. <a href="<?php the_permalink(); ?>">
  8. <?php if ( has_post_thumbnail() ) { the_post_thumbnail('full', array( 'class' => 'img-responsive img-rounded news-img' )); } ?>
  9. <p class="news-headline"><?php the_title(); ?></p>
  10. </a>
  11. <p><?php the_excerpt(); ?></p>
  12. <a href="<?php the_permalink(); ?>">
  13. <p class="pull-right">Read more...</p>
  14. </a>
  15. <span class="clearfix"></span>
  16. </div>
  17. </div>
  18. </div>
  19. <?php
  20. endwhile;
  21. endif;
  22. ?>
  23.  
  24. <?php
  25. $count = 0;
  26. query_posts('cat=2 && showposts=3');
  27. if (have_posts()) : while (have_posts()) : the_post();
  28. if($count == 0)
  29. {
  30. ?>
  31. <div class="col-xs-12 col-sm-4">
  32. <div class="column">
  33. <div class="news-article">
  34. <p class="news-date"><?php the_time( get_option( 'date_format' ) ); ?></p>
  35. <a href="<?php the_permalink(); ?>">
  36. <?php if ( has_post_thumbnail() ) { the_post_thumbnail('full', array( 'class' => 'img-responsive img-rounded news-img' )); } ?>
  37. <p class="news-headline"><?php the_title(); ?></p>
  38. </a>
  39. <p><?php the_excerpt(); ?></p>
  40. <a href="<?php the_permalink(); ?>">
  41. <p class="pull-right">Read more...</p>
  42. </a>
  43. <span class="clearfix"></span>
  44. </div>
  45. </div>
  46. </div>
  47. <?php
  48. $count = 1;
  49. }
  50. else
  51. {
  52. //Some other layout here
  53. }
  54. endwhile;
  55. endif;
  56. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement