Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. add_filter( 'the_content', 'customizing_woocommerce_description' );
  2. function customizing_woocommerce_description( $content ) {
  3.  
  4. // Only for single product pages (woocommerce)
  5. if ( is_product() ) {
  6.  
  7. // The custom content
  8. $args = array( 'taxonomy' => 'product_cat' );
  9. $terms = get_terms('product_cat', $args);
  10.  
  11. $count = count($terms);
  12. // if ($count > 0) {
  13.  
  14. foreach ($terms as $term) {
  15. /* echo $term->description;*/
  16.  
  17.  
  18.  
  19. $custom_content = '<p class="custom-content">' . __($term->description, "woocommerce").'</p>';
  20.  
  21. // Inserting the custom content at the end
  22. $content .= $custom_content;
  23. // }
  24.  
  25. }
  26. }
  27. return $content;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement