O
O
ole922017-06-24 13:00:16
WordPress
ole92, 2017-06-24 13:00:16

ACF + WooCommerce?

I am creating a custom field called width for the product category. I'm trying to display content-product_cat.php in the template, but it doesn't work. Tried these options:
<?php the_field('width', bedroom); ?>
bedroom - category label
<?php the_field('width', Substituted category id); ?>
Please tell me what's wrong. Thanks in advance!
Solution:
<?php
$term_id = 47;
$term = get_term($term_id);
the_field('width', $term);
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Medvedev, 2017-06-24
@ole92

It’s good to deliver at random, there are docks)
https://www.advancedcustomfields.com/resources/get...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question