WordPress.org

Forums

WooCommerce - excelling eCommerce
Adding product category description under product grid. (5 posts)

  1. michaelr1988
    Member
    Posted 1 year ago #

    Hello WooCommercers,
    I have been trying to add the product category descriptions under the product grid on all category pages. I have been trying to do this for the past week with no luck.

    If anyone could help me understand what code I need to add to the editor and where to place it I would be very grateful.

    I want to have this on their for SEO purposes.
    Kind Regards,
    Michael

    http://wordpress.org/plugins/woocommerce/

  2. terrytsang
    Member
    Posted 1 year ago #

    @michaelr1988, i just manage to put product category descriptions under Category Title.

    Do put code below into your theme if you need that:

    add_action( 'woocommerce_after_subcategory_title', 'custom_add_product_description', 12);
    function custom_add_product_description ($category) {
    	$cat_id		=	$category->term_id;
    	$prod_term	=	get_term($cat_id,'product_cat');
    	$description=	$prod_term->description;
    
    	echo '<div class="shop_cat_desc">'.$description.'</div>';
    }
  3. michaelr1988
    Member
    Posted 1 year ago #

    Thanks terrytsang,
    I will give it a try. This has been driving me around the bend.
    Regards,
    Michael

  4. terrytsang
    Member
    Posted 1 year ago #

    Hi Michael,

    Do let us know the result whether that works for you do that other members can use that if needed :)

    Regards,
    Terry

  5. michaelr1988
    Member
    Posted 1 year ago #

    Unfortunately, I was enable to get this to work after trying over the weekend.

    I placed the code into the themes functions.php section with no luck.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic