Loop Ultimos 7 días
<?php
function filter_where($where = '') {
//only show posts published within the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
// Query posts
query_posts( 'cat=3&posts_per_page=1&orderby=rand' );
// The Loop
if (have_posts()) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php
endwhile; endif;
//remove the filter
remove_filter('posts_where', 'filter_where');
// Reset Query
wp_reset_query();
?>