Support

Account

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.