Home › Forums › Backend Issues (wp-admin) › Not all items are listed in the custom content listing in the backend. › Reply To: Not all items are listed in the custom content listing in the backend.
My apologies, this was not related to ACF. Richt after I posted this question I figured out it was a script in my child theme doing this. I have a script that is supposed to show only the upcoming events on the “Events” archive page. It was also affecting the listing in the backend. I fixed it by adding “&& !is_admin()” in the condition.
It might come in handy for someone else. This is the script I’m talking about:
function filter_event_archive_query($query)
{
if (is_post_type_archive('event') && $query->is_main_query() && !is_admin()) {
$meta_query = array(
array(
'key' => 'start_date_time',
'value' => date('Y-m-d H:i:s'),
'compare' => '>=',
'type' => 'DATETIME'
)
);
$query->set('meta_query', $meta_query);
$query->set('orderby', 'meta_value');
$query->set('order', 'ASC');
}
}
add_action('pre_get_posts', 'filter_event_archive_query');
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.