Last active
September 27, 2020 22:52
-
-
Save marklchaves/4c05e9183609ba0c63260478bed2527c to your computer and use it in GitHub Desktop.
Add Font Awesome Icon in Avada Theme's Secondary Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prototype for adding a Font Awesome icon to the secondary Avada header. | |
* | |
* 1) Telephone | |
* 2) Email | |
* | |
* 1) For the telephone, add the HTML/CSS directly into the Theme Options > Header > Phone Number For Contact Info | |
* E.g. Call Us Today! Call Us Today! <i class="fontawesome-icon fa-mug-hot fas circle-yes" style="border-color:#3e3e3e;background-color:#3e3e3e;font-size:15.84px;line-height:31.68px;height:31.68px;width:31.68px;margin-right:9px;color:#ffffff;"></i> 1.555.555.555 | |
* | |
* 2) For the email, use the filter hook below as an example. Add this to your | |
* child theme's functions.php file. | |
*/ | |
function my_custom_head_function_for_avada( $email ) { | |
$fa_icon_html = <<<EOT | |
<i class="fontawesome-icon fa-mug-hot fas circle-yes" style="border-color:#3e3e3e;background-color:#3e3e3e;font-size:15.84px;line-height:31.68px;height:31.68px;width:31.68px;margin-right:9px;color:#ffffff;"></i> | |
EOT; | |
return $fa_icon_html . $email; | |
} | |
add_filter( 'avada_header_contact_info_email', 'my_custom_head_function_for_avada' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screen Grab