WordPress.org

Support

Support » Miscellaneous » [Resolved] email address

[Resolved] email address

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    @esmi

    Forum Moderator

    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('info@yourdomain.com', 1 ); ?>?subject=Hello" target="blank"><?php _e('Contact me', 'your_text_domain'); ?></a>

    replace info@yourdomain.com with the email you want to insert.

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