Home › Forums › Front-end Issues › Orderby link array title › Reply To: Orderby link array title
What type of field is it? A link field?
A link field stores an array in the database, there isn’t any way to order posts by this type of field.
Here is an example of 2 link fields in the db:
a:3:{s:5:"title";s:9:"ACF Forum";s:3:"url";s:41:"https://support.advancedcustomfields.com/";s:6:"target";s:0:"";}
a:3:{s:5:"title";s:6:"Google";s:3:"url";s:23:"https://www.google.com/";s:6:"target";s:0:"";}
You’ll notice that the first thing that is different and will cause the sorting is
a:3:{s:5:"title";s:9:
compared to a:3:{s:5:"title";s:6
the 9 and 6 are the string lengths of the titles, so they would be sorted in this order. Also 10
would come before 5
. Given two link titles of the same length they would be sorted alphabetically.
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.