How to Add AdSense Advertisement in the First Paragraph of the Article
Are you looking for a wordpress plugin to add your adsense or any other advertisement beside the first paragraph of your article? Well you don’t need to install any plugin to add your advertisement in the first para of your post in wordpress, It can be achieved with simple few lines of CSS and HTML coding. Here is how to show your advertisement beside the first paragraph of your wordpress article.
Adding your advertisement inside the paragraph in wordpress just takes 4 steps, with this tutorial you can either add 300 x 250 medium rectangle or 468 X 60 banner advertisement to your article without using any wordpress plugin.
Also read:
- 5 Most Useful Tools for Bloggers from Small SEO Tools
- 5 Free Mockup Tools to Display Your Template on Different Devices
How to Add AdSense Advertisement In the First Paragraph?
Follow the steps below to display your adsense advertisement left to the first para in your article-
- Go to your wordpress backend, navigate to “Appearance >> Editor” and add the following CSS code to your child theme (or in custom CSS) [css] .ad-under-the-title{
- Now open Single Post (single.php) from the editor and find the code like <?php the_content(); ?>
- Add the following HTML code just before the code <?php the_content(); ?>
[html]
<div class=”ad-under-the-title”>
YOUR_AD_CODE_HERE
</div>
[/html]The CSS and HTML code you have just added creates the place for your advertisement inside the first paragraph of your wordpress article. Now let’s add your advertisement code
- Copy your 300 x 250 medium rectangle advertisement code and replace it with YOUR_AD_CODE_HERE text in single.php
text-align: center;
float: left;
margin: 20px 30px 10px 0;
}
[/css]
That’s it, you have added your AdSense advertisement in the first paragraph of your wordpress article. Just remove float: left; CSS code from CSS if you would like to add 468 X 60 banner advertisement before the first paragraph.
Awesome. Just used your tutorial to add adsense code to my post page. Thanks for writing this