php Query posts and cache the query
$bandeau_post = get_transient('top1_bandeau_post'); if (!is_array($bandeau_post) || count($bandeau_post)==0) { $args = array( 'posts_per_page' => 5 ); $bandeau_post = array(); $bandeau_post = query_posts($args); set_transient('top1_bandeau_post',$bandeau_post,60*60*$timeout); } foreach($bandeau_post as $post) : setup_postdata($post); // the display code endforeach;