A
A
artva2015-10-22 13:29:10
WordPress
artva, 2015-10-22 13:29:10

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; ?>

The value is displayed, but in this form:
string(34) "Text from the additional field"
What is wrong, please tell me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
artva, 2015-10-22
@artva

figured it out :)
it is written - var_dump($docs);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question