Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28775

    Hello,

    i want to have the like button on my page:

    <div class=”fb-like” data-href=”http://developers.facebook.com/docs/reference/plugins/like&#8221; data-width=”450″ data-show-faces=”true” data-send=”true”></div>

    Where do i have to put the Code in the Header.php to get this work?

    <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/de_DE/all.js#xfbml=1”;

    fjs.parentNode.insertBefore(js, fjs);

    }(document, ‘script’, ‘facebook-jssdk’));</script>

    Greets,

    Jan

    #138592

    Hey,

    Edit header.php, find this code:

    <?php
    /*
    * Hook that can be used for plugins and theme extensions (currently: the woocommerce shopping cart)
    */
    do_action('ava_main_header');

    ?>

    <div class='container'>

    Below, add the fb code:

    <div class="fb-like" data-href="http://developers.facebook.com/docs/reference/plugins/like" data-width="450" data-show-faces="true" data-send="true"></div>

    Edit footer.php, find this code:

    <![endif]-->
    <?php
    echo "<div class='bg_container' style='background-image:url(".$avia_config['fullscreen_image'].");'></div>";
    }
    ?>

    Add the fb 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/de_DE/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    Then add this on your Quick CSS or custom.css to adjust the position of the widget.

    .fb-like.fb_edge_widget_with_comment.fb_iframe_widget {
    position: absolute;
    right: 0;
    top: -10px;
    }

    It is better if you use a non-fixed header for this.

    Regards,

    Ismael

    #138593

    Great, works for me

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Facebook Like Button’ is closed to new replies.