I don't get it!!! I have managed to include the product category description in their respective pages. I have 6 categories which with four of them I need to add a description. From the four, three worked as it should. However, there is one of them that not only shows its description but also another category's.
There are two of each category for multiligual purpose. But you can see the four categories I need to add the description.
1 - Tops 2 - Bottoms 3 - One Pieces 4 - Sport Wear
The first three worked as it should. Ie. Bottoms category page.
But the fourth, Sport Wear keeps showing not only its description but also the Top category's as well.
I have already recreated the category Sport Wear, but it remained the same way. I have no clue why this is happening. Any idea would be very much appreciated.
Here is the link: https://morenabeachwear.com/en/product-category/sport-wear/
And here the code I used to loop and display description.
function action_woocommerce_archive_description( ) {
global $post;
$args = array( 'taxonomy' => 'product_cat');
$terms = wp_get_post_terms($post->ID,'product_cat', $args);
foreach ($terms as $term) {
if (is_product_category()) {
echo $term->description;
}
}
};
add_action( 'walker_edge_after_page_title','action_woocommerce_archive_description', 10, 2 );
wp_get_post_terms()
? – git-e-up$args
the default isall
. So it does work as well. – stemon