Home › Forums › Front-end Issues › Sorting by date › Reply To: Sorting by date
Hi @NWTD
Thanks for the screenshot. Can you confirm that this setting has never been changed and that all posts have saved in the correct format?
Perhaps you have another issue in your WP_Query args. The best way to find the issue is to remove parts from the args one at a time until the issue resolves itself.
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => -1,
'meta_key' => 'date_received',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
$query = new WP_query($args);
var_dump( $query->have_posts() );
Perhaps remove the orderby and order? perhaps remove the meta_key also?
Thanks
E
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.