How to cache wp_query with pagination using transients?
You need to set a unique transient key for each page of posts otherwise each page will output same posts. Here is a example. Focus on get_transient & set_transient functions. <?php $my_posts_query = get_transient( ‘my_unique_transient_key_’ . get_query_var( ‘paged’ ) ); if( false === $my_posts_query ) { $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => ’12’, … Read more