-
AuthorPosts
-
October 4, 2015 at 1:27 pm #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
October 4, 2015 at 10:47 pm #513420Hi 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,
BasilisOctober 5, 2015 at 12:44 am #513435Hello 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.
October 5, 2015 at 1:01 pm #513718Hi!
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,
JosueOctober 5, 2015 at 8:24 pm #514036Hello!
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!
October 5, 2015 at 9:51 pm #514060Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_action('wp_title', function() { return "Title & here*; });
Cheers!
JosueOctober 6, 2015 at 2:30 pm #514381Hi 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
October 6, 2015 at 2:49 pm #514384Hey!
Please change the code to following one
add_action('wp_title', function() { return "Title & here*"; });
Cheers!
YigitOctober 6, 2015 at 3:22 pm #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
October 6, 2015 at 5:57 pm #514649Hi,
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 -
AuthorPosts
- The topic ‘Ampersand’ is closed to new replies.