WooCommerce How to Display Shortcode Content Inside Product Page

In order to display shortcode content inside the WooCommerce product page add this snippet inside functions.php:

add_action( 'woocommerce_after_single_product_summary', 'my_shortcode', 5 );
 function my_shortcode() {
  echo '<div class="makeit-looks-good">';
  print do_shortcode ( '[social-share align="left" style="icon" counters="0" buttons="facebook,twitter,pinterest,linkedin,mail"]' );
  echo '</div>';	
}

To control the area where this shortcode will be rendered, use this WooCommerce Visual Hook Guide to hook it in the right place.

Scroll to Top