Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have intergrated wordpress transient system with w3 total cache. Now i can`t to do pagination for this query.

                <?php
                $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(); ?>
</a></div><?php endwhile; ?><?php endif; ?><?php wp_reset_query(); ?>   
share|improve this question
3  
How do you set 'paged1'? –  toscho Jul 20 '12 at 11:13
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.