Docs    Facebook    Customizations

Insert your own content every X number of posts

Add ads or content in between your Facebook posts.

var number_of_posts = 5,
    content_to_add = 'Add content here',
    i = 1;
$('#cff .cff-item').each(function(){
  if( i % number_of_posts == 0 ) $(this).after('<div class="cff-item">'+content_to_add+'</div>');
  i++;
});

Edit the variables on the first two lines to define how many posts to insert the content after and what content should be added. The content can be text or HTML.

If you need to only add the content to a specific feed then you can add a class to the shortcode:

Comments Box SVG iconsUsed for the like, share, comment, and reaction icons

2 months ago

Smash Balloon

Want to get more Instagram reel views?

Viral reels can get featured on the Explore page, which is where 50% of Instagram users go to discover new content monthly.

In this video, we’ll share tips to help your Instagram reels get more viewers.

... See MoreSee Less

Video image

Comment on Facebook

3 months ago

Smash Balloon

Do you have a YouTube channel you want to grow?

In this video, we share 5 of our best methods to help you increase the watch hours for your YouTube channel!

... See MoreSee Less

Video image

Comment on Facebook

3 months ago

Smash Balloon

▶️ YouTube shorts are short-form videos that can easily engage viewers with bite-sized content and keep them watching for more.

But if you’re not used to coding, embedding YouTube shorts can be tough.

In this video, you will learn how to embed YouTube Shorts on your WordPress website in a beautiful feed using the Smash Balloon YouTube Feed Pro plugin.

... See MoreSee Less

Video image

Comment on Facebook

4 months ago

Smash Balloon

Ever wanted to showcase your YouTube live streams on your website?

Here's a quick video tutorial to help you:
▶️
... See MoreSee Less

Video image

Comment on Facebook

Is there a way to include YouTube live chat in the live stream embed?

Load more

And then target that feed in the fourth line of the snippet above:

$('.feed1 .cff-item').each(function(){

To add different content in every X number of posts you can use the following:

var number_of_posts = 5,
    content_to_add = [
    'Content 1',
    'Content 2',
    'Content 3'
    ],
    i = 1,
    count = 0;
$('#cff .cff-item').each(function(){
   if( i % number_of_posts == 0 && count < content_to_add.length ){
     $(this).after('<div class="cff-item">'+content_to_add[count]+'</div>');
     count++;
   }
   i++;
});
support

Couldn’t find your answer in the docs?

Contact Support

Was this article helpful?