Search code examples
twigwordpress-themingadvanced-custom-fieldscustom-wordpress-pages

What is the proper Twig syntax to display a ACF custom field linked to a Taxonomy term


What would be the proper Twig syntax to print display a custom Taxonomy name of (genres) The ACF field name is book_genre and a the custom Taxonomy of "Business" is selected in this WordPress custom-post, The Twig syntax here {{ post.book_genre }} only outputs the ID of the Taxonomy on the page, but I need it to print the Taxonomy name of: "Business" I have also tried {{ post.terms('category') }} to no avail this just prints "Array"


Solution

  • Okay I finally was able to figure it out, it seems like {{ post.meta('book_genre') }} did what I needed it to do and print out the term name of "Business" (example only)

    However in the ACF Groups the Return Value of "Term Object" has to be selected.