Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'the_content', 'customizing_woocommerce_description' );
- function customizing_woocommerce_description( $content ) {
- // Only for single product pages (woocommerce)
- if ( is_product() ) {
- // The custom content
- $args = array( 'taxonomy' => 'product_cat' );
- $terms = get_terms('product_cat', $args);
- $count = count($terms);
- // if ($count > 0) {
- foreach ($terms as $term) {
- /* echo $term->description;*/
- $custom_content = '<p class="custom-content">' . __($term->description, "woocommerce").'</p>';
- // Inserting the custom content at the end
- $content .= $custom_content;
- // }
- }
- }
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement