Home › Forums › General Issues › Multiple ACF fields before excerpt › Reply To: Multiple ACF fields before excerpt
Hi Yormario, I believe you’re almost there! It looks like you are using the wrong field function for your situation.
The solution would be to use get_field()
which will allow you to get the input and store it in a variable to return.
If you want a more in depth explanation, the reason your ACF Fields are not showing in the right order is because the_field()
doesn’t return a value, but echos it. It is essentially the same as doing echo get_field();
This means the values aren’t stored and instead are echoed in the order they are called, before the filter function is returned.
More information here: https://www.advancedcustomfields.com/resources/get_field/
Also, small, but important difference you are missing the $
for the second field variable in the return statement.
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.