Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marklchaves/4c05e9183609ba0c63260478bed2527c to your computer and use it in GitHub Desktop.
Save marklchaves/4c05e9183609ba0c63260478bed2527c to your computer and use it in GitHub Desktop.
Add Font Awesome Icon in Avada Theme's Secondary Header
<?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' );
@marklchaves
Copy link
Author

Screen Grab

Screen Shot 2019-12-23 at 8 54 18 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment