• This is the code for pulling ‘event’, which is a custom post type. I need to pull events only from specific category. Please modify the below code to get the events from only one specific event category. Thanks..

    ———

    $loop = new WP_Query( array(

    ‘post_type’ => ‘event’,

    ‘posts_per_page’ => 10,

    ‘order’ => ‘DESC’,

    ‘orderby’ => ‘ID’,

    ‘meta_query’ => array(

    array(

    ‘key’ => ‘event_is_expired’,

    ‘value’ => ‘expired’,

    ‘compare’ => ‘!=’,

    ),

    array(

    ‘key’ => ‘event_date’,

    ‘value’ => date(‘Y-m-d’),

    ‘compare’ => ‘>’,

    ),

    ),

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need help in WP Query’ is closed to new replies.