php - WP : Custom Post Type pagination by cats Issue -


i'm going crazy i'm working on wordpress mobile theme , have issue pagination of custom post type. explanations :

this winery website. on website there 3 cats of wine. on single-wine.php want able navigate between wine wich on same cat. doesn't work want , don"t know why cause each use same code :

cat 1 : dry wines - pagination looks good

cat 2 : vintage wines - can navigate between 3 wines ( >< why ..?)

cat 2 : oxy wines - can navigate between 1 wines ( >< why ..?) next_post , previous_post function have same link time.

can me ? don't understand issue, i'm on since 2 days. single-wine query ? pagination ?

try on mobile understand : mas.triangle-fr.com

single-wine.php

<?php include('winecats-2.php');?> <?php wp_reset_query(); ?> <?php if (have_posts()) : ?> <?php while ( have_posts() ) : the_post();  ?>   <section id="wine-head"> <div class="containerwine"> <?php previous_post_link( '%link', '<i class="left"></i>', true); ?> <?php next_post_link( '%link','<i class="right"></i>', true); ?> 

wine-cats-2.php

<?php $args = array( 'post_type' => 'vins', 'cat' => the_category_id($echo=false), ); $query = new wp_query( $args ); ?> <?php if ($query->have_posts()) : ?> <header class="cat-header"> <h3 class="wine_nav"><i class="fa fa-caret-down"></i> <?= the_category($post->id); ?> </h3> <ul id="wine-dropdown">           <?php while ($query->have_posts()) : $query->the_post(); ?>     <li class="wine-item"><a href="<?php the_permalink(); ?>"  class="" data-id="" id="<?= $post->post_name?>"><?php the_title() ?></a></li>      <?php endwhile; ?> </ul> 


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -