To remove the space, you’ll need to modify the email styles. Here’s how you can do that:
add_filter( 'woocommerce_email_styles', 'custom_woocommerce_email_styles' );
function custom_woocommerce_email_styles( $css ) {
$custom_css = "
/* Remove padding/margin above the logo */
#template_header_image img {
margin: 0 !important;
padding: 0 !important;
}
";
return $css . $custom_css;
}
Another, more direct approach, would be to copy the email templates to your theme and then modify the styles there.
- Copy the WooCommerce email templates from
wp-content/plugins/woocommerce/templates/emails/
to yourtheme/woocommerce/emails/
.
- Edit the
email-header.php
in yourtheme/woocommerce/emails/
.
- Find the section that outputs the logo and adjust or remove any margin or padding CSS properties associated with it.
Lastly, if you’re not confident in coding, consider reaching out to a developer for more personalized assistance.
Best Regards,
Raza
WPRobo