Docs    Facebook    Customizations

Creating a dynamic Like Box

If you’re using a multifeed then you may want to either change which Like Box is being shown based on the first post in the feed, or you may want to add a Like Box to each post.

Add a Like Box for the author of the first post shown in the feed

1) First add a class to your feed by adding the following to the shortcode class="cff-dynamic-likebox"

2) Make sure to disable the existing Like Box, which can be done by adding the following to the shortcode exclude="likebox"

3) Add the following to the plugin’s Custom JavaScript section (Facebook Feed > Customize > Misc):

$('.cff-dynamic-likebox').append('<iframe src="'+$('.cff-dynamic-likebox .cff-item').first().attr("data-cff-from")+'" style="width: 100%; height: 70px;"></iframe>');

Add a Like Box to each post in a multifeed

To do this use the snippet below instead of the one above:

$('.cff-dynamic-likebox .cff-item').each(function(){ 
$(this).append('<iframe src="'+$(this).attr("data-cff-from")+'" style="width: 100%; height: 70px;"></iframe>');

Couldn’t find your answer in the docs?

Contact Support

Was this article helpful?