Reputation: 581
I'm creating a infinite scroll on home page ... and every post have fb share and like button everything is working good but the only problem is not getting the FB like Button on new post(Coming through AJAX) ...
<div class="fb-like" data-href="<?php echo get_permalink($page["ID"]); ?>" data-width="The pixel width of the plugin" data-height="The pixel height of the plugin" data-colorscheme="light" data-layout="button_count" data-action="like" data-show-faces="false" data-send="false"></div>
this the code used by me for fb-like ...
Upvotes: 0
Views: 117
Reputation: 432
Use below method in response to ajax request right after the append method.
FB.XFBML.parse();
To reparse the fb link within the div use below method.
FB.XFBML.parse(document.getElementById('foo'));
Upvotes: 1