Skip to content

Instantly share code, notes, and snippets.

@ryelle
Created March 27, 2019 17:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryelle/d46ba0c5d6404040b6227c6c6a702807 to your computer and use it in GitHub Desktop.
Save ryelle/d46ba0c5d6404040b6227c6c6a702807 to your computer and use it in GitHub Desktop.
remove_action( 'woocommerce_after_shop_loop_item', 'sp_loop_product_description', 6 );
add_action( 'woocommerce_after_shop_loop_item', 'sf_powerpack_add_shortcodes_short_description', 6 );
function sf_powerpack_add_shortcodes_short_description() {
global $product;
$wc_product = wc_get_product( $product );
if ( ! $wc_product ) {
return false;
}
$short_description = $wc_product->get_short_description();
if ( '' !== $short_description ) {
echo '<div itemprop="description">' . do_shortcode( wpautop( wptexturize( $short_description ) ) ) . '</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment