Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #513313

    Hi,

    My website title, entered in General Settings of WordPress, contains ampersand – &. This is not problem in browser, since it is rendered as an simple &, but in sent autoresponder emails within sender/ from field there is this code & amp ; instead of an &. Also when I check website title string translation in Polylang, “&” is replaced with “& amp ;”, in both languages and in original string.

    This is happening weather I enter html codes for ampersand or actual & in site title.

    Regards

    #513420

    Hi Simijonovic!

    That is how the ambersand is been translated, to HTML! We can not do much in that case and it is not an Enfold issue, more of a WordPress / HTML! Have you tried for a solution to WP forums?

    Regards,
    Basilis

    #513435

    Hello Basiliis!

    Yes, I tried on WP forums, and answer was that this is issue “with the plugin which sends emails”. So, I thought that, since I don’t have plugin that sends mail, but it is enfold contact form, maybe this is right place. I see that this is how & is translated to HTML, but except email From field everywhere else is OK.

    #513718

    Hi!

    Enfold uses wp_mail or mail to send the messages, the theme just sends the data and the server does the sending. That being said, have you tried putting & am; instead of & in General Options?

    Best regards,
    Josue

    #514036

    Hello!

    Yes, Josue, I did. At first that resolved problem. But, after Polylang installation (not sure if this is exact reason, but as a string and string translations of Site title in Polylang there is ampersand code) issue reappeared. I tried to enter again both plain ampersand and HTML code, but nothing helped.

    Knowing from some previous post that I found that you recommend WPML, I first addressed to Polylang creator, and he replied that this is a problem with the plugin which sends emails. Than I posted my question here because I had same problem before I installed Polylang.

    Maybe I could change value for Site title in HTML or from HTML, but I don’t know where to look for it. Maybe it is stored in database, or some file. (Now I am just throwing ideas because I really don’t know much about coding).

    Thanks!

    #514060

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    add_action('wp_title', function() {
       return "Title & here*;	
    });

    Cheers!
    Josue

    #514381

    Hi Josue,

    This returns error page:

    Parse error: syntax error, unexpected T_FUNCTION in enfold-child/functions.php on line 20

    line 20: add_action(‘wp_title’, function() {

    Regards,

    Ivan

    #514384

    Hey!

    Please change the code to following one

    add_action('wp_title', function() {
       return "Title & here*";	
    });

    Cheers!
    Yigit

    #514416

    :-)

    Quickest answer ever! Thank you!

    This resolve syntax error, but the problem with sender field in autoresponder emails remains: there is still & amp ; in From field.

    I wasn’t sure if should I replace Title & here with real title, and should I type HTML code for ampersand or & (because on my mobile its HTML, but in chrome is &) so I tried all options. But whatever I put between quotation marks the result is the same.

    Cheers!

    Ivan

    #514649

    Hi,

    Just to share this. Adding

    add_filter( ‘wp_mail_from_name’, ‘my_mail_from_name’ );
    function my_mail_from_name( $name )
    {
    return “YOUR FROM FIELD WITH AMPERSAND”;
    }

    to functions.php solved problem.

    Thanks for help.

    Regards,
    Ivan

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Ampersand’ is closed to new replies.