Home › Forums › General Issues › Product Category extra description › Reply To: Product Category extra description
@websteem that’s pretty much the same code I gave you!
Are you adding the code to your functions file?
You can add code to the archive-product.php template, it won’t be the code supplied though as you asked to use the woocommerce hooks.
If you want to add direct to the template, just use:
global $wp_query;
# get the query object
$category = $wp_query->get_queried_object();
#get the cat ID
$category_ID = $category->term_id;
echo '<p>Can we see this? Is '.$category_ID.' the right ID for this category?</p>'; #remove after debug
#get the field
$contenu_categorie = get_field( 'contenu_categorie', 'category_'.$category_ID );
#if we have data, show it
if( $contenu_categorie ){
echo $contenu_categorie;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.