As I have a auto feed website and I decide to use transient for improving website loading So I have a wp_query and I want to use transient for this query and expire it after 25 minutes

                    $portfolio = new WP_Query(array(
                    'post_status' =>'publish',
                    'post_type' =>'post',
                    'fields' => 'ids',
                    'cat' =>''.$link1.'',
                    'posts_per_page' =>'9'      
 if($portfolio->have_posts()) : 
                    while($portfolio->have_posts()) : $portfolio->the_post();?>
<a href="<?php the_permalink() ?>" target="_blank"><?php the_title(); ?></a>
<?php endwhile; endif; wp_reset_query(); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.