Hi,
I am asking for help to add a houzz button to my social icons in my footer. Help!
(www.scandinavianhomedesigns.com)
Rikke
Hey Rikke,
There is no option for this out of the box and this requires overriding the x_social_global
function that can be found in FUNCTIONS/GLOBAL/SOCIAL.PHP
so a child theme is necessary. If you haven’t setup a child theme yet, please backup your site and export your Customizer settings. Then follow this guide to setup a child theme.
Before I give you some guide, please note that at this point, you’ll be doing custom development. If you’re not comfortable with coding, it’s highly recommended to hire a professional web developer as your site might break. We do have an in-house custom development team that offer paid services, who may be able to assist. They can be contacted at pinnacle@theme.co if this is of interest to you.
Going on, copy the x_social_global
function to your child theme’s functions.php. You’ll see that the HTML structure of the social icon is as follows.
<a href="#social-url" class="social-class" title="social-title" target="_blank"><i class="x-icon-social-fontawesome-class" data-x-icon="&#xSocialUnicode;" aria-hidden="true"></i></a>
The Houzz is available in Font Awesome Icons, http://fontawesome.io/icon/houzz/. Given the HTML structure, replace the following:
-
#social-url
with your Houzz URL -
social-class
withhouzz
-
social-title
withHouzz
-
x-icon-social-fa-class
withx-icon-houzz
(get the fa class in the icon’s page in Font Awesome omittingfa-
) -
SocialUnicode
withf27c
(get the unicode in the icon’s page in Font Awesome)
The last part is to add your icon’s HTML to the global social icons output. To do that, put the HTML inside this code $output .= '<!-- icon HTML -->';
. It should look like:
$output .= '<a href="#" class="houzz" title="Houzz" target="_blank"><i class="x-icon-houzz" data-x-icon="" aria-hidden="true"></i></a>';
The final code that you should place in your functions.php is this:
/* X Social Global Override */
function x_social_global() {
$facebook = x_get_option( 'x_social_facebook' );
$twitter = x_get_option( 'x_social_twitter' );
$google_plus = x_get_option( 'x_social_googleplus' );
$linkedin = x_get_option( 'x_social_linkedin' );
$xing = x_get_option( 'x_social_xing' );
$foursquare = x_get_option( 'x_social_foursquare' );
$youtube = x_get_option( 'x_social_youtube' );
$vimeo = x_get_option( 'x_social_vimeo' );
$instagram = x_get_option( 'x_social_instagram' );
$pinterest = x_get_option( 'x_social_pinterest' );
$dribbble = x_get_option( 'x_social_dribbble' );
$flickr = x_get_option( 'x_social_flickr' );
$github = x_get_option( 'x_social_github' );
$behance = x_get_option( 'x_social_behance' );
$tumblr = x_get_option( 'x_social_tumblr' );
$whatsapp = x_get_option( 'x_social_whatsapp' );
$soundcloud = x_get_option( 'x_social_soundcloud' );
$rss = x_get_option( 'x_social_rss' );
$output = '<div class="x-social-global">';
if ( $facebook ) : $output .= '<a href="' . $facebook . '" class="facebook" title="Facebook" target="_blank"><i class="x-icon-facebook-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $twitter ) : $output .= '<a href="' . $twitter . '" class="twitter" title="Twitter" target="_blank"><i class="x-icon-twitter-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $google_plus ) : $output .= '<a href="' . $google_plus . '" class="google-plus" title="Google+" target="_blank"><i class="x-icon-google-plus-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $linkedin ) : $output .= '<a href="' . $linkedin . '" class="linkedin" title="LinkedIn" target="_blank"><i class="x-icon-linkedin-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $xing ) : $output .= '<a href="' . $xing . '" class="xing" title="XING" target="_blank"><i class="x-icon-xing-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $foursquare ) : $output .= '<a href="' . $foursquare . '" class="foursquare" title="Foursquare" target="_blank"><i class="x-icon-foursquare" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $youtube ) : $output .= '<a href="' . $youtube . '" class="youtube" title="YouTube" target="_blank"><i class="x-icon-youtube-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $vimeo ) : $output .= '<a href="' . $vimeo . '" class="vimeo" title="Vimeo" target="_blank"><i class="x-icon-vimeo-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $instagram ) : $output .= '<a href="' . $instagram . '" class="instagram" title="Instagram" target="_blank"><i class="x-icon-instagram" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $pinterest ) : $output .= '<a href="' . $pinterest . '" class="pinterest" title="Pinterest" target="_blank"><i class="x-icon-pinterest-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $dribbble ) : $output .= '<a href="' . $dribbble . '" class="dribbble" title="Dribbble" target="_blank"><i class="x-icon-dribbble" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $flickr ) : $output .= '<a href="' . $flickr . '" class="flickr" title="Flickr" target="_blank"><i class="x-icon-flickr" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $github ) : $output .= '<a href="' . $github . '" class="github" title="GitHub" target="_blank"><i class="x-icon-github-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $behance ) : $output .= '<a href="' . $behance . '" class="behance" title="Behance" target="_blank"><i class="x-icon-behance-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $tumblr ) : $output .= '<a href="' . $tumblr . '" class="tumblr" title="Tumblr" target="_blank"><i class="x-icon-tumblr-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $whatsapp ) : $output .= '<a href="' . $whatsapp . '" class="whatsapp" title="Whatsapp" target="_blank"><i class="x-icon-whatsapp" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $soundcloud ) : $output .= '<a href="' . $soundcloud . '" class="soundcloud" title="SoundCloud" target="_blank"><i class="x-icon-soundcloud" data-x-icon="" aria-hidden="true"></i></a>'; endif;
if ( $rss ) : $output .= '<a href="' . $rss . '" class="rss" title="RSS" target="_blank"><i class="x-icon-rss-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
$output .= '<a href="#" class="houzz" title="Houzz" target="_blank"><i class="x-icon-houzz" data-x-icon="" aria-hidden="true"></i></a>';
$output .= '</div>';
echo $output;
}
The result will look like this:
This guide is applicable for Font Awesome icons. You can also use image but bear in mind that image is not scalable and will require the use of custom media queries which is another phase in custom development.
Further improvements and issues arising from the use of this guide would be outside the scope of our support. For that, please contact our custom development team at pinnacle@theme.co.
Hope that helps.