Answer the question
In order to leave comments, you need to log in
How to display the value of the add. ACF fields from Woocommerce Wordpress taxonomy?
Guys, using the ACF plugin, I added an additional field to the Woocommerce "Product Categories" taxonomy. Now I'm trying to display it on the category page, like this:
<?php
// vars
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
// load content for this taxonomy term
$docs = get_field('seotxt', $taxonomy . '_' . $term_id);
var_dump($docs);
?>
<?php if($docs): ?>
<?php while($docs = has_sub_field('seotxt')): ?>
<p><?php the_sub_field('seotxt'); echo $docs; ?><br>
<?php endwhile; ?>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question