Viewing 2 replies - 1 through 2 (of 2 total)
  • Better use it right way. WordPress has core function antispambot() which obfuscates your email address ‘hiding’ it from spam bots. Also, you don’t need to hardcode the email address into template, this code automatically picks up blog admin email.

    <a class="email" href="mailto:<?php echo antispambot( get_bloginfo('admin_email', 'raw'), 1 ); ?>?subject=Hello" target="blank"><?php _e('Contact me', 'your_text_domain'); ?></a>

    To hardcode custom email address into temlate use this:

    <a class="email" href="mailto:<?php echo antispambot('[email protected]', 1 ); ?>?subject=Hello" target="blank"><?php _e('Contact me', 'your_text_domain'); ?></a>

    replace [email protected] with the email you want to insert.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘email address’ is closed to new replies.