WordPress.org

Support

Support » Plugins and Hacks » Electric Studio Auto Post Expire » [Plugin: Electric Studio Auto Post Expire] Sort Category by Expiry date?

[Plugin: Electric Studio Auto Post Expire] Sort Category by Expiry date?

Viewing 1 replies (of 1 total)
  • Hiya!

    Yes, in your WP_Query, add sorting by meta_value_num. The meta key is es_ape_expiry. Basically that’s a timestamp, so the lowest value is the one to expire soon. Don’t forget to add post_status.

    This should solve it:

    $args = array(
        'post_status' => 'publish',
        'meta_key' => 'es_ape_expiry',
        'order' => 'ASC',
        'oderby' => 'meta_value_num'
    );
    
    $new_posts = new WP_Query( $args );

    Gabor

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Electric Studio Auto Post Expire] Sort Category by Expiry date?’ is closed to new replies.
Skip to toolbar