Guest User

Untitled

a guest
Jul 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. $query = new WP_Query( $wpplnum );
  3.  
  4. while( $query->have_posts() ): $query->the_post();
  5. ?>
  6.  
  7. <div class="carousel-item col-md-4 active">
  8. <div class="card">
  9. <img class="card-img-top img-fluid" src="http://placehold.it/800x600/f44242/fff" alt="Card image cap">
  10. <div class="card-body">
  11. <h4 class="card-title">Card 1</h4>
  12. <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
  13. <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
  14. </div>
  15. </div>
  16. </div>
  17.  
  18. <div class="carousel-item col-md-4 <?php echo $query->current_post >= 1 ? '' : 'active'; ?>">
  19.  
  20. $query = new WP_Query($wpplnum);
  21.  
  22. $first = TRUE;
  23.  
  24. while($query->have_posts()):$query->the_post();
  25.  
  26. $class = "";
  27. if($first)
  28. {
  29. $class = "active";
  30. $first = FALSE;
  31. }
  32. ?>
  33.  
  34. <div class="carousel-item col-md-4 <?php echo esc_attr( $class ); ?>">
  35.  
  36. .....
  37.  
  38. </div>
Add Comment
Please, Sign In to add comment