I’m using a page template to display posts from a category in the bootstrap accordion format and also to echo a wordpress gallery plugin on the same page. The problem is i can’t get them both to work together (see below). As soon as i remove the accordion the gallery displays which makes me think the PHP is clashing?
Can anyone help please?
<?php
/*
Template Name: Corporate client & services
*/?>
<?php get_header(); ?>
<div class="hero-image"> <?php echo the_post_thumbnail(); ?> </div>
<div class="page-title">
<div class="container"> <?php echo get_the_title(); ?> </div>
</div>
<div class="opening-text">
<div class="container">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; else: ?>
<p>
<?php _e('Sorry, this page does not exist.'); ?>
</p>
<?php endif; ?>
</div>
</div>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<?php $catquery = new WP_Query( 'cat=15&order=ASC&posts_per_page=10' ); while($catquery->have_posts()) : $catquery->the_post(); ?>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<div class="container">
<a data-toggle="collapse" class="collapsed" data-parent="#accordion" href="#collapse<?php echo $i; ?>" aria-expanded="true" aria-controls="collapseOne">
<h4 class="panel-title">
<?php the_title(); ?><div class="stock-level"></div>
</h4></a>
</div>
</div>
<div id="collapse<?php echo $i; ?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-7 col-md-7 col-lg-7 recycled-image">
<?php echo the_post_thumbnail(); ?>
</div>
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5">
<h1><?php the_title(); ?></h1>
<p><?php the_content(); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $i++; endwhile; ?>
</div>
</div>
</div>
</div>
<div class="thumbnails">
<div class="container">
<?php if( function_exists( 'easy_image_gallery' ) ) {
echo easy_image_gallery();
}?>
</div>
</div>
<div class="opening-text">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5 bottom-image"> <?php echo types_render_field("enter-a-image-to-display", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));?> <?php echo types_render_field("enter-a-video-to-display", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));?> </div>
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5">
<div class="bottom-title"><?php echo types_render_field("enter-title", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));?></div>
<div class="bottom-text"> <?php echo types_render_field("enter-text", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));?> </div>
</div>
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>