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
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!