WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have integrated WordPress transient system with w3 total cache. Now I can`t to do pagination for this query.

  $paged1 = (get_query_var('paged1')) ? get_query_var('paged1') : 1;
  $recent1 = get_transient( 'recent1' );
  if ( false === $recent1) {
    $recent1 = new WP_Query ('cat=3&posts_per_page=5'.'&paged='.$paged1);
     set_transient('recent1', $recent1, 60*60);
  // do normal loop stuff
  if ($recent1->have_posts()) : while ($recent1->have_posts()) : $recent1->the_post();
<div id="line">
  <a href="<?php the_permalink () ?>" rel="bookmark">
    <h2><?php the_title (); ?></h2>
    <?php the_post_thumbnail(array(100,100), array('class' => 'alignleft')); ?>
    <?php the_advanced_excerpt(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>  
share|improve this question
How do you set 'paged1'? – toscho Jul 20 '12 at 11:13

Did you try this?

$paged1 = (get_query_var('page')) ? get_query_var('page') : 1;
share|improve this answer
Yes, i have tried. It is work but there is a problem. Sometimes on page/2 there is content of page/1 or on the contrary. It seems caches sometimes confused. How to set they right ?) – Ronin Jul 21 '12 at 23:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.