Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Display the menu of categories, essa parte funciona OK -->
- <?php
- $catList = get_categories(
- array(
- 'child_of' => 103,
- 'orderby' => 'id',
- 'order' => 'ASC',
- 'hide_empty' => '0'
- ) );
- ?>
- <div class="accordion" id="accordionExample">
- <?php $c = 1 ?>
- <?php foreach($catList as $catItem) : ?>
- <div class="card">
- <div class="card-header" id="<?php echo $catItem->slug?>-tab">
- <h5 class="mb-0">
- <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?>">
- <?php echo $catItem->name?>
- </button>
- </h5>
- </div>
- </div>
- <?php $c++ ?>
- <?php endforeach ?>
- <!-- End of Display the menu of categories -->
- <!-- Aqui o loop para cada categoria, Essa parte nao funciona -->
- <?php $c = 1 ?>
- <?php foreach($catList as $catItem) : ?>
- <?php
- $argsPosts = array(
- 'post_type' => 'depoimentos',
- 'posts_per_page' => 10,
- 'post__not_in' => get_option( 'sticky_posts' ),
- 'cat' => $catItem->cat_ID
- );
- ?>
- <?php $bladeQuery = new WP_Query($argsPosts); ?><?php if($bladeQuery->have_posts()) : ?><?php while ($bladeQuery->have_posts()) : ?><?php $bladeQuery->the_post(); ?>
- <div id="<?php echo $catItem->slug?>" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
- <div class="card-body">
- HEAR THE CONTENT OF EACH TESTIMONIALS
- </div>
- </div>
- </div>
- <?php endwhile; ?><?php endif; ?><?php wp_reset_postdata(); ?><!-- end query -->
- <?php $c++ ?>
- <?php endforeach ?>
- </div>
Add Comment
Please, Sign In to add comment