S
S
Sergey Burduzha2021-06-17 16:17:34
WordPress
Sergey Burduzha, 2021-06-17 16:17:34

How to display custom acf field value for taxonomy on post page?

Good afternoon.
Has no one ever needed to display a custom taxonomy field on a post page?
Everywhere on the web there is a $term object, which is retrieved from get_queried_object on the category, taxonomy page and acf is displayed through it. And how to get without $term? So I get terms on the post page, and then?
$field = get_field('some', $term);

<?php $terms = get_the_terms(get_the_ID(), 'writer');?>

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IvanMogilev, 2021-06-17
@serii81

$field = get_field('some', $term->taxonomy . '_' . $term->term_id)

More or less like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question