Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #327924

    Hi there,

    I am trying to add Facebook follow button on my website.

    So, I went on this here and got the code. But I don’t know where to install the code in appearance –> editor section.

    Then when I go to enfold layout builder, I don’t know if I should just insert code block.

    Could you explain me the steps please?

    Thank you!
    Ali

    #328107

    Hey Ali

    Code block element should work fine. Do you mind sharing the code you got with us? If you do not, please paste it here http://pastebin.com/ and post the link here

    Best regards,
    Yigit

    #328611

    Hi Yigit,

    so it says:

    Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.

    <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/en_US/sdk.js#xfbml=1&version=v2.0″;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, ‘script’, ‘facebook-jssdk’));</script>

    Place the code for your plugin wherever you want the plugin to appear on your page.
    <div class=”fb-follow” data-href=”https://www.facebook.com/alimeseu&#8221; data-colorscheme=”light” data-layout=”standard” data-show-faces=”true”></div>

    I tried inserting it into the code block element but it doesn’t appear. Let me know what you think I should do exactly.

    Thank you!
    Ali

    #328662

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    function add_facebook_sdk() {
    	?>
    	<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/en_US/sdk.js#xfbml=1&version=v2.0";
    	fjs.parentNode.insertBefore(js, fjs);
    	}(document, 'script', 'facebook-jssdk'));</script>
    	<?php
    }
    add_action('wp_footer', 'add_facebook_sdk');

    Then the only code you put on the page content would be this:

    <div class="fb-follow" data-href="https://www.facebook.com/alimeseu" data-colorscheme="light" data-layout="standard" data-show-faces="true"></div>
    

    Cheers!
    Josue

    #328691

    Hi there,

    i did but it doesn’t work. It is still invisible, fb follow button doesn’t appear.

    I inserted the code at the very very end of functions.php.

    Then I added the second line on the “code block” on the content layout editor.

    Let me know what is missing?
    Thanks!
    Ali

    #328701

    Hey!

    Can you post a link to the page where you are trying this?

    Best regards,
    Josue

    #328704

    Hi!

    1. Go to the code generator here
    2. Click Get code and select the iframe tab
    3. Copy the code and add it to a code block in your page
    Example code

    
    <iframe src="//www.facebook.com/plugins/follow.php?href=https%3A%2F%2Fwww.facebook.com%2Fzuck&width&height=80&colorscheme=light&layout=standard&show_faces=true&appId=682368698498023" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>

    4. Check the “Output the code without any additional wrapper elements.” in the code block settings

    Regards,
    Arvish

    #328735

    Hi,

    I did what you said but it still doesn’t work. See here

    I am trying to place it on the white section under the top bar with the twitter button.

    Could you check?

    Thanks!
    Ali

    #328788

    Hey!

    It is working. It is hidden behind hellobar iframe.

    See below

    If you want to make it appear over the hellobar, perhaps try positioning the fb iframe absolutely and play with the z-index.

    Regards,
    Arvish

    #328805

    Oh, thanks for that!!

    Sorry for being such a pain. One last thing, how i can place this follow button at the centre of this section (both horizontally and vertically, without it being folded in 2 lines)?

    Thank youuu!
    Ali

    #328831

    Hi!
    I believe you need to increase the width of the iframe.
    Then specify
    margin: 0 auto;
    to shift the iframe in the middle.
    Cheers!
    Arvish

    #328835

    Hi!
    Just realised that iframe won’t support these margin changes.

    Try this instead:

    In clode block settings
    1. Add “div” to “Code Wrapper Element”
    2. Add “class=”test” to “Code Wrapper Element Attributes”
    3. The Add the following to your custom.css or Quick CSS in Enfold theme options

    .test {
        width: 300px;
        margin: 0px auto;
    }

    Cheers!
    Arvish

    #329436

    Thank you so much, Arvish! So kind of you!! You guys rock!

    It is working now. The only problem is on Internet Explorer, it looks like this

    The top header is disproportionately big. Any clue?

    Thank you!
    Ali

    #330012

    Hi!

    I checked the site on IE9 – IE11 and it looks the same with Chrome.

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.