Last active
April 14, 2020 07:07
-
-
Save neilgee/039a36b9d21593ee042a to your computer and use it in GitHub Desktop.
WooCommerce Move Product Description Above Product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //<~ don't add me in | |
add_action( 'woocommerce_before_single_product', 'themeprefix_woocommerce_template_product_description', 20 ); | |
/** | |
* Add product description above product | |
* Output description tab template using 'woocommerce_before_single_product' hook | |
*/ | |
function themeprefix_woocommerce_template_product_description() { | |
wc_get_template( 'single-product/tabs/description.php' ); | |
} | |
add_filter( 'woocommerce_product_tabs', 'themeprefix_woo_remove_product_tabs', 98 ); | |
/** | |
* Remove WooCommerce Description Tab | |
*/ | |
function themeprefix_woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
return $tabs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment