Support

Account

Home Forums General Issues Email obfuscation Reply To: Email obfuscation

  • I’ll post the my full code here in hopes that seeing all of it might reveal some issues. I am extremely new to PHP so this may look like a train wreck. (I use the genesis framework).

    <?php
    /**
     * Template Name: Professional Single
     */
    
     //* Adding ACF on prefessionals pages 
    add_action( 'genesis_before_entry_content', 'rma_pro_single_acf' );
    function rma_pro_single_acf() {
    
    // If fields are present
    if( get_field('headshot') ||
    	get_field('pro_role') ||
    	get_field('pro_office_phone') ||
    	get_field('pro_cell_phone') ||
    	get_field('pro_email') ||
    	get_field('pro_linkedin')):
    
    $theEmail = get_field('pro_email');
    
      echo
    '<div class="professional-details clearfix">
    			<div class="one-third first">
    				<img src="' . get_field('headshot') . '">
    			</div>
    
    			<div class="two-thirds contact-details">
    				<h6>' . get_field('pro_role') . '</h6>
    				<p><span class="data">Office:</span>' . get_field('pro_office_phone') . '</p>
    				<p><span class="data">Mobile:</span>' . get_field('pro_cell_phone') . '</p>
    				<p><span class="data">Email:</span><a href="mailto:'.antispambot($theEmail).'">' . $theEmail . '</a></p>
    				<p><span class="data">Connect:</span><a href="' . get_field('pro_linkedin') . '"><i class="fa fa-linkedin-square fa-lg"></i> Linkedin</a></p>
    			</div>
    		</div>';    
    
        endif;
    
     }
    
    genesis();
     
    ?>