Home › Forums › General Issues › Sort custom posts by date from two diffrent custom field › Reply To: Sort custom posts by date from two diffrent custom field
You cannot posts by the date field in a different post, you can only order posts by fields that belong to those posts.
You will need to create an acf/save_post filter for your gallery post type. In this filter you will need to see if there is a related event. If there is then you get the date from the related event and update the date field for the gallery. Then you order by this one date field.
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.