Advertisement
lorro

WooCommerce - Move description under product image

Feb 14th, 2017
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. <?php
  2.   // WooCommerce - Move description under product image
  3.   // code goes in functions.php for your child theme
  4.  
  5.   add_filter( 'woocommerce_product_tabs', 'remove_description_tab', 60 );
  6.   function remove_description_tab($tabs) {
  7.     if ( isset( $tabs['description'] ) ) {
  8.       unset( $tabs['description'] );
  9.     }
  10.     return $tabs;
  11.   }
  12.  
  13.   add_action( 'woocommerce_before_single_product_summary', 'custom_open_div', 5 );
  14.   function custom_open_div() {
  15.     echo '<div class="product_page_left_side">'.PHP_EOL;
  16.   }
  17.  
  18.   add_action( 'woocommerce_before_single_product_summary', 'custom_show_description', 60 );
  19.   function custom_show_description() {
  20.     global $post;
  21.     echo '<h3>Description</h3>'.PHP_EOL;
  22.     echo the_content();
  23.   } // end function
  24.  
  25.   add_action( 'woocommerce_before_single_product_summary', 'custom_close_div', 80 );
  26.   function custom_close_div() {
  27.     echo '</div>'.PHP_EOL;
  28.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement