Place WooCommerce Product Title Above Gallery Image on Mobile Only

function your_custom_function_name() {
	global $product;
	if ( ! is_admin() && is_product() && wp_is_mobile() ) {
	remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); 
	add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 10 );
	}
};
	
	add_action( 'woocommerce_before_single_product_summary', 'your_custom_function_name', 1 );

Goal: Move WooCommerce Product Title to a different part of the Product page when on mobile.

The ! is_admin() && is_product() && wp_is_mobile() functions are an if conditional that means only display the WooCommerce Product Title if all 3 of the following conditions are met: NOT in admin AND is a WooCommerce Product page AND is mobile.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *