Guest User

Untitled

a guest
Jul 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <!-- Display the menu of categories, essa parte funciona OK -->
  2. <?php
  3. $catList = get_categories(
  4. array(
  5. 'child_of' => 103,
  6. 'orderby' => 'id',
  7. 'order' => 'ASC',
  8. 'hide_empty' => '0'
  9. ) );
  10. ?>
  11. <div class="accordion" id="accordionExample">
  12. <?php $c = 1 ?>
  13. <?php foreach($catList as $catItem) : ?>
  14. <div class="card">
  15. <div class="card-header" id="<?php echo $catItem->slug?>-tab">
  16. <h5 class="mb-0">
  17. <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#<?php echo $catItem->slug?>" aria-expanded="<?php echo ($c == 2)?'true':'false'; ?>" aria-controls="<?php echo $catItem->slug?>">
  18. <?php echo $catItem->name?>
  19. </button>
  20. </h5>
  21. </div>
  22. </div>
  23. <?php $c++ ?>
  24. <?php endforeach ?>
  25. <!-- End of Display the menu of categories -->
  26.  
  27. <!-- Aqui o loop para cada categoria, Essa parte nao funciona -->
  28. <?php $c = 1 ?>
  29. <?php foreach($catList as $catItem) : ?>
  30. <?php
  31. $argsPosts = array(
  32. 'post_type' => 'depoimentos',
  33. 'posts_per_page' => 10,
  34. 'post__not_in' => get_option( 'sticky_posts' ),
  35. 'cat' => $catItem->cat_ID
  36. );
  37. ?>
  38.  
  39. <?php $bladeQuery = new WP_Query($argsPosts); ?><?php if($bladeQuery->have_posts()) : ?><?php while ($bladeQuery->have_posts()) : ?><?php $bladeQuery->the_post(); ?>
  40. <div id="<?php echo $catItem->slug?>" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
  41. <div class="card-body">
  42. HEAR THE CONTENT OF EACH TESTIMONIALS
  43. </div>
  44. </div>
  45. </div>
  46. <?php endwhile; ?><?php endif; ?><?php wp_reset_postdata(); ?><!-- end query -->
  47. <?php $c++ ?>
  48. <?php endforeach ?>
  49. </div>
Add Comment
Please, Sign In to add comment