-2

I have used Advance Custom Field (ACF) wordpress plugin to add custom filed on Woocommerce -> Product -> Categories form.

Right now i can't able to print that field value on categories page.

Please see this screen shot to know field slug name and other details -> http://nimb.ws/BsSiJO and help me to show that field value on categories page.

Thanks, Ketan.

Ketan
  • 579
  • 3
  • 11
  • 31

1 Answers1

0

Display a field

<p><?php the_field('field_name', $term); ?></p>

Retrieve a field

<?php

$variable = get_field('field_name', 'product-cat_23');

// do something with $variable

?>

Finding the term related to the current post

<?php

// load all 'category' terms for the post
$terms = get_the_terms( get_the_ID(), 'category');


// we will use the first term to load ACF data from
if( !empty($terms) ) {

    $term = array_pop($terms);

    $custom_field = get_field('category_image', $term );

    // do something with $custom_field
}

?>
Bilal Hussain
  • 994
  • 1
  • 10
  • 25
  • Thanks for the comment. But above code i also see on ACF document but that cant help me. So please review this my field http://nimb.ws/BsSiJO and Can you please make perfect code for me. Thanks. – Ketan Sep 07 '17 at 10:14