Domanda

Sto facendo una query personalizzata utilizzando WP_Query per ottenere i messaggi di una categoria specifica, ma per alcuni collegamenti motivo di navigazione per la lista non appaiono. C'è un modo per ottenere i più recenti / link anziani di presentarsi e di lavoro utilizzando un WP_Query personalizzato?

Questo è quello che sto facendo:

<?php $mainList_query = new WP_Query('cat=4,352,731,754,49,44,54,17&showposts=200&order=DESC'); ?>
<?php if($mainList_query->have_posts()) : while($mainList_query->have_posts()) : $mainList_query->the_post(); ?>

   <div class="articleSection">

            <h2 class="headlinelist"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <div class="byline2"><?php the_time('F jS, Y') ?> by <?php the_author() ?> at <?php the_time() ?> </div>
    <?php if ( in_category( array(754,49,44,54,17) ) ) { ?>
    <img src="<?php bloginfo('template_url'); ?>/images/360btn.jpg" width="67" height="16" alt="" />
    <?php } ?>
    <?php if ( in_category(4) ) { ?>
    <img src="<?php bloginfo('template_url'); ?>/images/ps3btn.jpg" />
    <?php } ?>
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?></p>
   </div>


  <?php endwhile; ?>


  <div class="navigation">

   <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>

   <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>

  </div>


 <?php else : ?>

  <h2 class="center">Not Found</h2>

  <p class="center">Sorry, but you are looking for something that isn't here.</p>

  <?php get_search_form(); ?>


 <?php endif; ?>
È stato utile?

Soluzione

Provare l'aggiunta di '& paging ='. $ Paging alla stringa di query

<?php $mainList_query = new WP_Query('cat=4,352,731,754,49,44,54,17&showposts=200&order=DESC&paged='.$paged); ?>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top