Advertisement
Guest User

Untitled

a guest
Aug 17th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. <?php $args = array( 'post_type' => 'clientes'); $loop = new WP_Query($args); ?>
  2. <?php $counter = 4; ?>
  3. <div class="container">
  4. <div class='row'>
  5. <div class='col-md-12'>
  6. <div class="carousel slide media-carousel" id="media">
  7. <div class="carousel slide media-carousel" id="eventCarousel" data-interval="0">
  8. <div class="carousel-inner onebyone-carosel">
  9. <h2 class="text-center">Nossos clientes</h2>
  10. <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  11. <div class="item <?php if($counter == 4){echo "active"; } ?>">
  12. <div class="col-md-3">
  13. <h4 class="text-center">
  14. <?php the_title(); ?>
  15. </h4>
  16.  
  17. <a href="<?php echo do_shortcode(get_post_meta($post->ID,'site_cliente', true )); ?>" target="_blank">
  18. <?php echo odin_thumbnail(420,420, 'Clientes', true, 'cliente' ); ?>
  19. </a>
  20.  
  21. <div class="text-center">
  22. <a href="<?php echo do_shortcode(get_post_meta($post->ID,'facebook_cliente', true )); ?>" target="_blank"></a>
  23. </div>
  24. </div>
  25. </div>
  26. <?php $counter++ ?>
  27. <?php endwhile; ?>
  28. </div>
  29. <a data-slide="prev" href="#eventCarousel" class="left carousel-control">‹</a>
  30. <a data-slide="next" href="#eventCarousel" class="right carousel-control">›</a>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36.  
  37. <script>
  38. $(document).ready(function () {
  39. $('#productsCarouselXs').carousel({
  40. interval: 4000
  41. })
  42. $('#eventCarousel .item').each(function () {
  43. var next = $(this).next();
  44. if (!next.length) {
  45. next = $(this).siblings(':first');
  46. }
  47. next.children(':first-child').clone().appendTo($(this));
  48.  
  49. if (next.next().length > 0) {
  50. next.next().children(':first-child').clone().appendTo($(this));
  51. }
  52. else {
  53. $(this).siblings(':first').children(':first-child').clone().appendTo($(this));
  54. }
  55.  
  56. if (next.next().next().length > 0) {
  57. next.next().next().children(':first-child').clone().appendTo($(this));
  58. }
  59. else {
  60. $(this).siblings(':first').children(':first-child').clone().appendTo($(this));
  61. }
  62.  
  63. });
  64. });
  65. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement