Skip to content

Instantly share code, notes, and snippets.

@delvinkrasniqi
Created April 9, 2020 08:43
Show Gist options
  • Save delvinkrasniqi/d987702c546e422fa3078cf2d2b1e3c7 to your computer and use it in GitHub Desktop.
Save delvinkrasniqi/d987702c546e422fa3078cf2d2b1e3c7 to your computer and use it in GitHub Desktop.
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-md-12">
<div class="accordion" id="accordionExample">
<div class="card">
<?php
$args = array(
'post_type' => 'card',
'posts_per_page' => '-1',
);
$loop = new WP_Query($args);
while ($loop->have_posts()) :
$loop->the_post();
$id = get_the_ID();
?>
<!-- wrapperi -->
<div class="card-header" id="<?php echo $id; ?>">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#c<?php echo $id; ?>" aria-expanded="true" aria-controls="collapseOne">
<p>
<?php the_title();?>
</p>
</button>
</div>
<div id="c<?php echo $id; ?>" class="collapse" aria-labelledby="<?php $post->ID;?>" data-parent="#accordionExample">
<div class="card-body">
<?php the_content();?>
</div>
</div>
<!-- end of wrapperi -->
<?php
endwhile;
wp_reset_postdata();
?>
</div>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment