Support

Account

Home Forums Front-end Issues Add category description with Advanced Custom Field

Helping

Add category description with Advanced Custom Field

  • Hello. I want to add custom field to shop categories page only, some additional category description. The page what I want customize: https://viveska911.com.ua/produkcyia/

    But I dont have enough experience to do that. Please help.

    I have added field in advanced custom fields settings, and I know that I should edit content-product_cat.php, but I dont know how.

  • I have copied content-product_cat.php to my theme Woocommerce folder and tried this answer

    /**
    	 * woocommerce_after_subcategory hook.
    	 *
    	 * @hooked woocommerce_template_loop_category_link_close - 10
    	 */
    	do_action( 'woocommerce_after_subcategory', $category ); ?>
    
    <?php 
     $queried_object = get_queried_object(); 
    $taxonomy = $queried_object->taxonomy;
    $term_id = $queried_object->term_id;  
     
    $thumbnail = get_field('productdesc', $queried_object);
     
    $thumbnail = get_field('productdesc', $taxonomy . '_' . $term_id);
    
    ?>    
    
    <?php the_field( 'productdesc', $queried_object ); ?>

    But it doesnt help. Any help please!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.