I have an email mailto
href link, and when I use a &
character in the subject, this prevents any code rendering after this ampersand in the email subject line. i.e. Oil & Gas
, just shows as Oil
.
Under normal conditions I would just change the &
to the word and
, but the subject line is dynamically generated via post titles in Wordpress.
Does anyone know how I can prevent the subject line breaking, or in other words how I can get the &
to show as a text character?
A stripped out version of the code is below:
<a href="mailto:joe@example.com?subject=Oil&Gas">Apply</a>
Although in the HTML of the site this is pulled in using:
<a href="mailto:<?php echo $author_email;?>?subject=<?php the_title(); ?>">Apply</a>
Any help or ideas would be fabulous and I'm not sure if this will be html, php or Javascript solution?
mailto
links are obsolete. This could be for a non-public-facing site where harvesting is not an issue.