I’m working with taxonomy page order by terms whit different WP_Query. AT the last of every loop something add a “post” that have page title and info from the before post. Very strange thing.

I don’t find nothing about this (neither I know how to search this). Thanks por your time. My doce is this:

      <?php
  $the_query = new WP_Query( array(
      'post_type' => 'intervencion',
      'tax_query' => array(
          array (
              'taxonomy' => 'especialidad',
              'field' => 'slug',
              'terms' => 'bariatrica_ok',
          )
      ),
  ) );

  while ( $the_query->have_posts() ) : $the_query->the_post();?>
          <?php $meta = get_post_meta(get_the_ID()); ?>
      <div class="col-lg-3 col-md-4 col-sm-6">
          <div class="ficha">
              <?php if ( has_post_thumbnail() ) { ?>
                  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumb_intervenciones', array('class' => 'img-responsive')); ?></a>
              <?php } ?>
              <h2><?php echo get_the_title(); ?></h2>
              <p class="condiciones">Todo</br>incluido por:</p>
              <p class="precio"><?php echo $meta['intervenciones_precio_intervencion'][0]; ?> &euro;</p>
              <a class="ficha-btn" href="<?php the_permalink()?>">Solicitar cita</a>
          </div>
      </div>
<?php
  endwhile;

  wp_reset_postdata();
  ?>

  <div class="col-lg-3 col-md-4 col-sm-6">
      <div class="ficha">
          <?php if ( has_post_thumbnail() ) { ?>
              <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumb_intervenciones', array('class' => 'img-responsive')); ?></a>
          <?php } ?>
          <h2><?php echo get_the_title(); ?></h2>
          <p class="condiciones">Todo</br>incluido por:</p>
          <p class="precio"><?php echo $meta['intervenciones_precio_intervencion'][0]; ?> &euro;</p>
          <a class="ficha-btn" href="<?php the_permalink()?>">Solicitar cita</a>
      </div>
  </div>

The result at the bottom of the list is:
enter image description here

Read more here: WP_Query taxonomy terms add one more post


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: