Viewing 15 replies - 1 through 15 (of 22 total)
  • Make a child theme.

    Copy:
    wp-content/plugins/woocommerce/templates/emails/email-styles.php
    to
    wp-content/themes/my-child-theme-name/woocommerce/emails/email-styles.php

    In the copy, find the h1 section, then change the text-align property to
    text-align: center;

    Thread Starter cfm168

    (@cfm168)

    Hi Lorro,

    Thank you for helping. Can I just copy and edit this part only?

    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 ); ?>;
    }

    Yes.

    Thread Starter cfm168

    (@cfm168)

    Thanks a lot!!

    Your post that I said Yes to was edited after I posted. I said Yes, you shouldn’t have the /templates/ folder in the target path.

    No, you can’t just copy the h1 section and edit that. You need to copy the whole file and edit the h1 section in the copy.

    For the benefit of those that may come here later.

    Thread Starter cfm168

    (@cfm168)

    @lorro, Thank you for reminder.

    How can I edit h1 to align to ‘center’ from following code?
    text-align: <?php echo is_rtl() ? ‘right’ : ‘left’; ?>;

    I don’t under stand why the original code using ‘right’ : ‘left’; it is confusing me.

    That’s for some languages that use left to right text and others that use right to left text. Take out that line and replace it with text-align: center;

    Thread Starter cfm168

    (@cfm168)

    Hello @lorro,

    I got this error alert:
    ————————————
    PHP Parse error: syntax error, unexpected end of file in /home/mysite.com/wp-content/themes/twentyeleven-child/woocommerce/emails/email-styles.php on line 228
    ———————————
    The ending line 228 is <?php, that I copied from entire original file I can see.

    I don’t get email notification at all now (maybe client same too) due to above error. Can you help?

    Thanks in advance!

    Please post the whole thing here: https://pastebin.com/ and post just the link in this forum.

    Thread Starter cfm168

    (@cfm168)

    There should be a newline after the last <?php. So:

    <?php
     
    Thread Starter cfm168

    (@cfm168)

    Add one more line 229 with <?php
    So ending with double <?php ?

    Thread Starter cfm168

    (@cfm168)

    The ending like this:

    <?php
    <?php

    Is that right?

    Thank in advance!

    Thread Starter cfm168

    (@cfm168)

    Just tested and got error logs again for the last two lines of <?php

    Instead, I deleted last two <?php, goes ending with }, test from email template in setting, it seems like the email working now. No error log created.

    And also, the “text-align:center” does’t work from the email template look up. I can see still showing “left” from chrome inspec tools.

    No, only one <?php, then press return, so the last line is a blank line. This is how it is in the original template. When you copied it, you didn’t copy the last empty line.

    Removing the <?php altogether should work.

    text-align: center; must have a semi-colon at the end.

Viewing 15 replies - 1 through 15 (of 22 total)

The topic ‘Align center for mails subject’ is closed to new replies.