How To Install Ad Slot Before and After Post Contents Blogger

How To Install Ad Slot Before and After Post Contents Blogger

November 21, 2018

For those of you who want to display ads, either banner ads or special AdSense ad units such as In-article Ads in the post, you can follow the method below.

How to make ad slots before and after posting
How To Install Ad Slot Before and After Post Contents Blogger

First, open the Blogger dashboard> click the Themes menu and Edit HTML> Search this code

 <b:if cond='data:blog.pageType == "item"'>
<data:post.body/>
</b:if>


  • Then add the code below to wrap the banner or ad code


     <b:if cond='data:blog.pageType == "item"'>
    <div class='adcss ax'>
    <!-- Your Ad Here Code Here-->
    </div>
    <data:post.body/>
    <div class='adcss ax'>
    <!-- Your Ad Here Code Here-->
    </div>
    </b:if>
    
    Replace the code marked with your banner or ad code. An example like this, here I use the AdSense In-article code

    Also add CSS code before </ head>


    <b:if cond='data:blog.pageType == "item"'>
    <style type='text/css'>
    .aadcss{margin:20px auto 0 auto}
    .adcss.ax{margin:20px auto}
    </style>
    </b:if>
    Finish, click the Save theme in the template editor. done.

      Load Comments