I am trying to add an additional class to the very first post of a custom post in wordpress and I am using the following code on my template part that I got from sof site but it is showing an error.
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\e24xp\wp-content\themes\e24x\testimonial.php on line 19
<?php
$args = array( 'post_type' => 'cc_testimonial', 'posts_per_page' => 1, "order" => "DESC");
$query = new WP_Query( $args );
$cc = count($query);
if ( $query->have_posts() ) {
$i=0;
while ( $query->have_posts() ) {
$query->the_post();
<div class="testimonialitem item <?php echo ($i==0)?'active':''; ?>">//SHOWING ERROR
<div class="testimonial-content">
<p><?php the_title( );?></p>
</div>
</div><!--/.testimonialitem-->
$i++;
}
}
wp_reset_query();
wp_reset_postdata();
?>
What is wrong in this code??