Display Post for Category within Last 90 Minutes
-
Hey,
I’m looking for some help with a custom query loop. I am trying to display posts for a certain category that where posted within that last 90 minutes. The script I’ve written is working, but it knocks out all the other loops and queries on the page. Here’s what I have:
<?php
global $post;
function filter_where( $where = ” ) {
// posts in the last 90 minutes
$where .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-90 minutes’)) . “‘”;
return $where;
}
add_filter( ‘posts_where’, ‘filter_where’ );$query = new WP_Query( $query_string.’&cat=979′ );
while ($query->have_posts()) : $query->the_post(); ?>
Hi
<?php endwhile; wp_reset_query(); ?>Any help would be great, as I hope to do this in a couple more places.
Thanks
- The topic ‘Display Post for Category within Last 90 Minutes’ is closed to new replies.