Docs    Facebook    Customizations

Link to the Facebook Page of Group after loading posts X number of times

If you’d like to link users to view your Facebook page or group after loading more posts into your feed X number of times, then just add the following snippets.

First, add a class to the feed that you want to apply this to:

[custom-facebook-feed class=”cff-limit-clicks”]

Then, add this to the plugin’s Custom JavaScript section (Facebook Feed > Customize > Misc > Custom JavaScript):

var clickCount = 0,
clickLimit = 2,
linkToFacebook = 'https://facebook.com/my-page-or-group';
$('.cff-limit-clicks').on('click', '.cff-load-more', function(){
clickCount++;
if( clickCount >= clickLimit ){
$(this).after('<a href="'+linkToFacebook+'" target="_blank" class="link-to-group">View more on Facebook</a>');
$(this).remove();
}
});

Change the clickLimit number to be the number of clicks on the Load More button that you want to limit the user to.

Change the linkToFacebook to be the link of your Facebook page or group that you’d like to use on the button.

Change cff-limit-clicks to be whatever class you used in your shortcode.

Then add this to the Custom CSS section which is immediately above it:

#cff .link-to-group{
  ​width: 100%;
  text-align: center;
  display: block;
  background: rgba(255,255,255,0.5);
  padding: 5px;
  border-radius: 5px;
​}

Technical Support

Still have questions? We are here to help you succeed.

Open a support ticket