I'm using Wordpress with the "Advanced Custom Fields" plugin, and I'm trying to call variables from the plugin into my TWIG file.
The documentation for the plugin says to use <?php the_field('field_name'); ?>
in the PHP, but I can't figure out how to translate that code to TWIG.
I tried the following:
- Running code as is (but it appears TWIG doesn't run pure PHP.)
{% post.the_field('my_fields_name') %}
, but to no avail{{ post.my_fields_name }}
, but it printed/logged "Array" to the frontend.{{ post.get_field('the_field', my_fields_name) }}
and{{ post.get_field('the_field', 'my_fields_name') }}
Any help will be greatly appreciated