Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display topics younger than X

  • @corypina

    Participant

    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?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar