Skip to content

Instantly share code, notes, and snippets.

@growdev
Last active January 20, 2023 06:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save growdev/2a11b09bf19fd1ae3f4d to your computer and use it in GitHub Desktop.
Save growdev/2a11b09bf19fd1ae3f4d to your computer and use it in GitHub Desktop.
Moving the location of the WooCommerce Variable Product Description on the product page
<?
/* Add this to your theme's functions.php to move the variation description display to a different location
* on the product page.
*/
add_action('plugins_loaded', 'move_variation_description', 50);
function move_variation_description(){
// Remove the hook from the original location
remove_action( 'woocommerce_single_product_summary', array( WC_Variation_Description::get_instance()->frontend, 'add_variation_description' ), 25 );
// Re-add the hook to where you want it to be
add_action( 'woocommerce_before_single_product_summary', array( WC_Variation_Description::get_instance()->frontend, 'add_variation_description' ), 25 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment