Displaying the Ad after nth post with Beaver Post module

How do you add the google adsense or any third party ad code after nth post in the Beaver Post module’s list layout? In this tutorial I am addressing it. Follow the instruction at below:

Note: Before editing the file you will keep a backup of your theme and already built the blog page using Beaver Post module and did the following settings

  1. Layout is List
  2. Source (under Content tab) is Custom Query

Now open the functions.php file and add this simple PHP snippet at end of the file

Above script is adding the Ad between 2nd & 3rd post. You can change the position. Edit the line no 7 and replace 2 with your own custom number.

Output will be look like this:

Third Party Ad below 2nd Post

Displaying the Beaver Builder Plugin Advertisement after 2nd Post

Leave a Comment

You must be logged in to post a comment.

Newsletter

Get free weekly PRO Beaver Builder Tutorials

shares