Home › Forums › Front-end Issues › What's wrong with this Query › Reply To: What's wrong with this Query
Hi @melissaspiegel,
Thanks for the post.
I believe you will need to add the meta_query for the ‘is_event’ custom field and comment out the meta_query that you have.
Your code should ultimately look like so:
<?php
$events = array (
‘tag_name’ => ‘oldevents’,
‘posts_per_page’ => ‘9’,
‘post__not_in’ => get_option(‘sticky_posts’),
‘orderby’ => ‘meta_value_num’,
'meta_key' => 'event_date',
'order' => 'ASC',
);
// The Query
$the_query = new WP_Query($events);
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.