Home › Forums › General Issues › Product Category extra description › Reply To: Product Category extra description
Hi @websteem
Odd, if you use the below, what do you see?
add_action( 'woocommerce_after_main_content', 'my_extra_description' );
function my_extra_description() {
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;
}
}
I’ve just tested the above with your field name on the twenty-twentyone theme and worked
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.