Home › Forums › General Issues › If get_fields is empty not working › Reply To: If get_fields is empty not working
It’s working well with the IF condition so this is not the problem 🙂 The problem is that the variable is always empty even if I ise get_field() or the_field() 🙂
If I use this code like this (without the if) it’s ordering like a charm !
$query_array = array(
‘post_status’ => ‘publish’,
‘post_type’ => ‘show-item’,
‘posts_per_page’ => $params[‘number_of_items’],
‘orderby’ => $params[‘orderby’],
‘order’ => $params[‘order’]
);
$query_array[‘meta_key’] = ‘date_de_debut’;
$query_array[‘orderby’] = ‘meta_value’;
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.