Home › Forums › ACF PRO › Return Featured articles first › Reply To: Return Featured articles first
Hi.
I had a similar problem where I had a custom post type for FAQ’s and I wanted to put the top five questions at the top then followed by the rest.
I was tearing my hair out before I saw John’s answer above. At least in my case I had to update all the posts after I had created the custom field I wanted to sort against.
It could be even more elaborate I guess but this does the trick for me.
$args = array(
'post_type' => 'faq',
'posts_per_page' => -1,
'meta_key' => 'top_five',
'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.