<?php get_header(); ?>
<div id="section1-inner">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
<div class="left-sec1">
<img src="<?php bloginfo('template_directory'); ?>/images/logo.jpg" alt=""></div>
<div class="left-sec2"><h2>Category</h2></div>
<div class="left-sec3">
<ul><?php if ( !dynamic_sidebar('Product Category') ) ?></ul>
</div>
<div class="left-sec4">
<ul><?php if ( !dynamic_sidebar('Homepage Banner') ) ?></ul>
</div>
</div>
<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
<div class="form-gap"><?php get_search_form(); ?></div>
<div class="gallery"><?php wd_slider(1); ?></div>
<div class="clearfix"></div>
<h3 class="title"><?php printf( __( '%s', '' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h3>
<?php
$query = new WP_Query( array( 'post_type' => 'product', 'orderby' => 'menu_order', 'order' => 'ASC', 'showposts' => 5) );
while ( $query->have_posts() ) {
$query->the_post();?>
<?php wp_reset_postdata(); } ?>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="pbox">
<center><?php the_post_thumbnail(); ?></center>
<h3><a href="<?php the_permalink(); ?>"><?php the_title( ); ?></a><br></h3>
<h4><?php the_field('offer_price', $taxonomy); ?></h4>
<h5><?php the_field('price', $taxonomy); ?></h5>
<p class="text-center"><a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/download.png" alt=""></a></p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
Here is my wordpress category page coding.
When I was putting this code into category.php page, it is only showing 1 category posting under the post_type of "Product" .
As for example, I already created 3 category: Category 1, Category 2, Category 3 and each category have 3 post. So as per my above code, it is showing only 1 post.
But I want to show all posting under each category posting.
can anyone help me?