set transient for wp_query and refresh it after 25 minutes


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(); ?>
m.javad koushki 1 week 0 Answers 4 views 0

Leave an answer