Support

Account

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