Home › Forums › General Issues › How to display highest number value in post field by author name? › Reply To: How to display highest number value in post field by author name?
Hi @mswas
Thanks for the screenshots. To achieve the 3 questions above, you will need to add a field to the user. This field will contain the ‘reviews’ number.
For now, you can ask your editors to manually edit this number when they post a new review (edit profile, update custom field and save profile). You could also write some code to do this automatically, but lets talk about that later (after you have achieved 1,2,3 above).
With each user now containing a custom field for the ‘reviews’ number, you can use the WP_User_Query to query the users and display them in a list.
You can also output the user custom field (checkout the docs for more info on users) and sort them based on the custom field value based on teh custom field value!
This should solve all your problems!
basically, it won’t be possible to achieve the above with your current data setup and the user custom field is needed.
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN
— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.