Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ********************How to add facebook comment in your website easily and make it responsive************************
- ------------------------------------From Facebook------------------------
- 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-comments" data-href="http://www.yoursiteurl.com/" data-numposts="5" data-colorscheme="light"></div>
- Note: Normally facebook comment box is not responsive.If you want to make it responsive in all devices copy below css code and past this in your stylesheet.
- .fb_iframe_widget,
- .fb_iframe_widget span,
- .fb_iframe_widget span iframe[style] {
- min-width: 100% !important;
- width: 100% !important;
- }
- Note:If you want to see your commented post link with your fb post in your timeline just place the following code wherever you want the plugin to appear on your page....
- <div class="fb-comments" data-href="<?php the_permalink(); ?>" data-numposts="5" data-colorscheme="light"></div>
- ********************************************************** Thank You **************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement