For what it’s worth, I tried updating the ACF for this particular image, and since then, it’s removed itself from the category.
Here’s what it looks like in a Category Term:
When adding a new category term, I have the option to upload an image, but once saved, the image options disappear.
That worked. Thanks!
Ah!
Also, check that you don’t have any ‘pre_get_post’ filters that are modifying the args
That put me int he right direction. none of the other orderby arguments seem to work.
I changed up the query to:
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => '-1',
'meta_key' => 'date_received',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
remove_all_filters('posts_orderby');
$query = new WP_query($args);
And that fixed it. If this was in the documentation, my apologies for not seeing it. Either way, I’m good to go and thank you for your help.
Thanks for the response @elliot.
My apologies for not clearing this up sooner. My query displays the posts. They’re just not ordered by the meta_key defined in the query. The meta_key is a datepicker from ACF.
Here’s how the query looks on the front end: http://imgur.com/ANmN8ft
Notice how the dates are not in order? The posts are in order by the post date, not the date set forth by the advanced custom field.
I hope that helps to clear up any confusion.
Yes it is. See: http://imgur.com/d3XV93C
Thanks for the response @elliot. Is it something that could be requested as a paid add-on or to the core?
My apologies for the confusion.
My code prints out the loop that I want, however, it is not sorted by the date field that I specified. I just need my loo[p to list items in chronological order based on the date field that is specified in the query.
'meta_key' => 'date_received',
'orderby' => 'meta_value_num',
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.