1)
来自
#template_container
可以在
templates/emails/email-styles.php
第58-63行@4.0.0版。
#template_container {
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
background-color: <?php echo esc_attr( $body ); ?>;
border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>;
border-radius: 3px !important;
}
2)
$email_heading
调用模板文件时传递,请参阅
includes/class-wc-emails.php
第263-270行@2.3.0版
/**
* Get the email header.
*
* @param mixed $email_heading Heading for the email.
*/
public function email_header( $email_heading ) {
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
}
然而,风格注入也通过
templates/emails/email-styles.php
第176-185行@4.0.0版
h1 {
color: <?php echo esc_attr( $base ); ?>;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 30px;
font-weight: 300;
line-height: 150%;
margin: 0;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>;
}
所以要回答你的问题:
如果要应用自己的样式,或要修改现有样式。您必须覆盖模板文件。可以通过将模板文件复制到
yourtheme/woocommerce/emails/email-styles.php
.
另见:
Template structure & Overriding templates via a theme - How to Edit files