Created
February 21, 2017 16:08
-
-
Save bogdanpopa90/f0991ed35cf30577c1dab3bd12603127 to your computer and use it in GitHub Desktop.
Change product description display on single product in WooCommerce
This file contains hidden or 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 | |
/** | |
* Change product description display on single product | |
*/ | |
function belise_woocommerce_template_single_excerpt() { | |
global $post; | |
if ( ! $post->post_excerpt ) { | |
return; | |
} | |
?> | |
<div class="custom-class" itemprop="description"> | |
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ); ?> | |
</div><?php | |
} | |
?> |
This file contains hidden or 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 | |
// Remove default | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); | |
// Add new description display | |
add_action( 'woocommerce_single_product_summary', 'CUSTOM_woocommerce_template_single_excerpt', 20 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment