Tagged: Email Obfuscation, Email protection
- This topic has 9 replies, 3 voices, and was last updated 8 years, 6 months ago by Theme Horse Support Team.
-
AuthorPosts
-
March 7, 2016 at 6:11 am #43212altiusParticipant
Hi,
Are all the email addresses display in the theme protected from bot harvesting email address (protected from spam)? If not do you have recommendation to obfuscate (protect) these email addresses? Please advise. Thank you.March 9, 2016 at 6:58 am #43296Theme Horse Support TeamKeymasterHi Shegga,
Sorry! Email address that display in the top bar is not spam protected. We use it as a contact purpose. If you would like to protect it then you may use plugin available free in wordpress.org but we can not recommended any plugin and also can not guarantee that thirty party plugin works fine in our theme.
Thank you!
April 12, 2016 at 10:21 am #44211altiusParticipantCan you give me a solution to protect the email address on the top and bottom bar? It is part of your theme design and even when use as contact purpose, I believe prone to be harvested by spambot.
April 12, 2016 at 11:01 am #44214Theme Horse Support TeamKeymasterHi shegga,
Yes you can do one thing. Install this plugin Email Address Encoder from WordPress directory.
Doing it you go to theme folder -> inc -> structure -> header-extension.php on line no 173 you will find below code
$interface_footer_infoblog .= is_email($options[ 'social_email'] );
Replae above code with this code
$interface_footer_infoblog .= eae_encode_str( is_email($options[ 'social_email'] ) );
Note: We recommended not to change the code because if you change the code then while updating to our new version all your customisation code will be lost. So better make child theme and first unhook the functions and the edit the code.
Thank you!
April 20, 2016 at 12:44 pm #44359altiusParticipantAfter I implement the code, how can I see that the email protection is actually working?
April 21, 2016 at 10:10 am #44383Theme Horse Support TeamKeymasterHi shegga,
View your source code and then you will not see normal email id. For example you can view this image
Thank you!
April 22, 2016 at 6:06 am #44404altiusParticipantI have tried creating the child theme with modified header-extension.php file (per your instruction) with the same folder structure but still not working. Please help me with the proper instruction in how to create a child theme in relation with your theme and the email protection. Thank you.
April 22, 2016 at 7:49 am #44406Theme Horse Support TeamKeymasterHi shegga,
To create a child theme view WordPress Codex for Child Theme. Also we have replied many times how to create a child theme. Search Child Theme and you will get more solutions of creating it.Create a child folder inside wp-content -> themes -> (your child theme folder (name is as interface-pro-child)) Create style.css file and add the below code on style.css
/* Theme Name: Interface Pro Child Theme URI: https://www.themehorse.com/themes/interface-pro Author: Theme Horse Author URI: https://www.themehorse.com Description: Interface Pro is a Simple, Clean and Flat Responsive Retina Ready WordPress Theme. It is easily customizable with numerous theme options. Some of the highlighted options are two site layout (Narrow and Wide), 4 layouts for every post/page, 5 Page Templates, 8 widget areas, 6 custom widgets, featured slider to highlight your post/page, 10 social icons, top and bottom info bar to hightlight your contact/email/location and many more. Also has custom background, header, menu, favicon, CSS, webclip icon, and logo. Supports popular plugins like Breadcrumb NavXT, WP-PageNavi and Contact Form 7. It is also translation ready. Get free support at https://www.themehorse.com/support-forum/ and View beautiful demo site at https://www.themehorse.com/preview/interface-pro Version: 3.0.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: white, light, green, two-columns, left-sidebar, right-sidebar, fluid-layout, custom-menu, custom-background, custom-header, featured-images, full-width-template, theme-options, threaded-comments, translation-ready, sticky-post Text Domain: interface Template: interface-pro */
Doing only this Your child theme is created. Now to make your email address secure it needs code customization. Create a functios.php file and add the below code under it
<?php add_action( 'wp_enqueue_scripts', 'interface_enqueue_styles' ); function interface_enqueue_styles() { wp_enqueue_style( 'interface', get_template_directory_uri() . '/style.css' ); } function interface_footer_infoblog( $set_flags, $place ='') { global $array_of_default_settings; $options = wp_parse_args( get_option( 'interface_theme_options', array() ), interface_get_option_defaults()); $interface_footer_infoblog = ''; $place = ''; if($set_flags || (!empty($options['social_phone'] ) || !empty($options['social_email'] ) || !empty($options['social_location']))){ $interface_footer_infoblog .= '<div class="info-bar"> <div class="container clearfix">'; if(!empty($options['social_phone'] ) || !empty($options['social_email'] ) || !empty($options['social_location']) ) { $interface_footer_infoblog .= '<div class="info clearfix"> <ul>'; if ( !empty($options['social_phone'] )){ $interface_footer_infoblog .= '<li class=' .'"phone-number"'. '><a title='. __( '" Call Us "', 'interface' ).' '. 'href=' .'"tel:' ; $interface_footer_infoblog .= preg_replace("/[^() 0-9+-]/", '', $options[ 'social_phone' ]) ; $interface_footer_infoblog .= '">'; $interface_footer_infoblog .= preg_replace("/[^() 0-9+-]/", '', $options[ 'social_phone' ]) ; $interface_footer_infoblog .= '</a></li>'; } if (!empty($options['social_email'] )){ $interface_footer_infoblog .='<li class=' .'"email"'. '><a title=' . __( '" Mail Us "', 'interface' ). ' ' . 'href=' .'"mailto:'; $interface_footer_infoblog .= eae_encode_str( is_email($options[ 'social_email'] ) ); $interface_footer_infoblog .='">'; $interface_footer_infoblog .= is_email($options[ 'social_email'] ); $interface_footer_infoblog .='</a></li>'; }if(!empty($options['social_location'])){ $interface_footer_infoblog .='<li class=' .'"address"' .'>'; $interface_footer_infoblog .= esc_attr($options[ 'social_location']); $interface_footer_infoblog .= '</li>'; } $interface_footer_infoblog .= '</ul> </div><!-- .info -->'; } } else if($place == "header" && $set_flags == 1 ) $interface_footer_infoblog .= '<div class="info-bar"> <div class="container clearfix">'; echo $interface_footer_infoblog; } ?>
Thank you!
April 22, 2016 at 3:05 pm #44412altiusParticipantPutting the code in the function.php works. My earlier attempt using the same file and folder structure doesn’t work.
Thank you.April 25, 2016 at 9:56 am #44461Theme Horse Support TeamKeymasterThat’s great
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.