O
O
Oblom4ik2017-10-25 10:36:23
Taxonomy
Oblom4ik, 2017-10-25 10:36:23

How to display custom taxonomy field on archive page via ACF?

Friends, please help.
I'm riveting a template for WP and faced an impossible task for me.
I needed to display the description in parts: above the products and below the products.
I figured I'd create a custom field for the taxonomy and display it on the archive page, but that wasn't the case.
The taxonomy was created through the Custom Post Type UI plugin, the custom field was created through ACF (advancedcustomfields.com).
At the moment, I am training on taxonomy with id 23. The following code works on the taxonomy-products_category.php template:

<?php echo get_field('little-text', products_category_23); ?>

I don't understand how to automatically pick up the id from the page.
On the Internet, I googled only a non-working version:
<?php echo get_field('little-text', 'products_category_'.$tax->term_id); ?>
Also, I will not refuse alternative options for displaying 2 different texts on the archive page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2017-10-25
@Oblom4ik

get_queried_object()
It's not entirely clear what you mean.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question