Hello I have a custom post type event
and i have two custom fields:
- event_date
- event_type
I want to display all my events which has event_type
= Featured
and sorting should be by event_date
in DESC
order..
I have searched everywhere on SOF but unable to find any working solution.. Here is my code right now
$events = new WP_Query(
array(
'post_type' => 'event',
'post_status' => 'publish',
'meta_key' => 'event_type',
'meta_value' => 'featured',
'posts_per_page' => -1,
'orderby' => 'event_date',
'order' => 'DESC'
)
);