Display topics younger than X
I’m trying to create a version of the Popular Topics widget that will only display posts that are less than a certain age.
I’ve been able to query popular posts with this:
$query = new WP_Query( array( 'posts_per_page' => 5, 'post_type' => 'topic', 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value', 'order' => 'DESC' );
But I would like to weed out any posts that are, let’s say, older than 1 week.
Is it possible to do this?
Can I somehow use an additional meta query and access each topic’s freshness?
- You must be logged in to reply to this topic.