Created
April 25, 2012 17:34
-
-
Save jimmynotjim/2491531 to your computer and use it in GitHub Desktop.
Adaptive sizing for FB comments plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- New HTML5 FB Comments --> | |
<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/all.js#xfbml=1"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> | |
<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="4" data-width="320px"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Styles to force FB Comments to span the width of it's container // | |
.fb-like-box, .fb-like-box span, .fb-like-box.fb_iframe_widget span iframe, | |
.fb-comments, .fb-comments span, .fb-comments.fb_iframe_widget span iframe { | |
width: 100% !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added FB Like Box classes if you're interested: https://gist.github.com/2778984