Add a custom Phone Number and facebook Like button – only one icon visible
-
Hi.
I am about to combine 2 codes and one is affecting the other. Both of them works nice if not combined, no issues. If phone number icon is active and I add Like button, phone icon is not visible.
added to Functions.php
Add a custom Phone Number Font Awesome icon to the Social Icons
https://presscustomizr.com/snippet/add-custom-phone-number-font-awesome-icon-social-icons/
Adding a Facebook like button in the header
https://presscustomizr.com/snippet/adding-a-facebook-like-button-in-the-header//** adds the script in the head of your theme */
add_action (‘wp_head’ , ‘add_fb_button_script’);
function add_fb_button_script() {
?>
<div id=”fb-root”></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/cs_CZ/sdk.js#xfbml=1&version=v2.7”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>
<?php
}/** adds the button on the right to the social icons in header */
add_filter (‘tc_social_in_header’ , ‘add_fb_button’, 10, 2);
function add_fb_button($html, $resp) {
$class = (‘resp’ == $resp) ? ”:’span5′
?>
<div class=”social-block <?php echo $class ?>”>
<?php if ( 0 != tc__f( ‘__get_option’, ‘tc_social_in_header’) ) : ?>
<?php echo tc__f( ‘__get_socials’ ) ?>
<?php endif; ?>
<div class=”fb-like” data-href=”https://www.facebook.com/dvereprovily/” data-width=”50″ data-layout=”button_count” data-action=”like” data-size=”large” data-show-faces=”true” data-share=”false”></div> <!–.social-block–>
<?php
}And position of menu and basket in a mobile view changes as well. Moves to the second line and is not on the right side as usually .
Help how to combine both options would be very appreciated.
Thank you.
Igor
https://www.dvereprovily.cz
- The topic ‘Add a custom Phone Number and facebook Like button – only one icon visible’ is closed to new replies.