I just wanted to post this quick tips article as I am sure it will be helpful to other webmasters. If you are looking for a way to put adsense ads after the first paragraph of each entry in your wordpress blog OR if you want to place an adsense ad block after second or third paragraph of each entry, then here is what you can do.
The following need some simple code editing in wordpress template file (single.php)
1. Find the php file – single.php in your wordpress blog themes folder.
2. search for the code: <?php the_content(); ?>
3. Replace the above code with the following:
<?php
$paragraphAfter= 1; //display after the first paragraph
$content = apply_filters('the_content', get_the_content());
$content = explode("</p>", $content);
for ($i = 0; $i <count($content); $i++) {
if ($i == $paragraphAfter) { ?>
<div>
Your add code here
</div>
<?php
}
echo $content[$i] . "</p>";
} ?>
You can now place your adsense ad code into the place where it is written “Your ad code here”. You can also change the number of paragraph after which you would like your adsense ad to appear. This can be done by replacing the number in the code $paragraphAfter= 1 with the paragraph number after which you want the ad to be seen. I sure hope this is helpful.
If you are working with Intellilinks, sometimes you may find a message in your email inbox with the subject line “Important: Link Missing”. Well, first time when I saw the message I panicked. But you don’t need to, because it’s easy to solve the problem.
Well, there can be two reasons why the Links are missing from your website:
- The plugin is not working properly.
- The theme you are using is not widget enabled.
So, check if the Intellilinks plugin has been installed properly. You may opt to download a new plugin and install it all over again. That way you can make sure the plugin is working right.
The next thing will be to check if the Wordpress Template you are using is Widget-enabled. The widget feature is already present in your wordpress install, so you don’t need to install any widget plugin. The only thing is you need to make sure that your blog theme is widget-enabled. To check that, go to your wordpress theme management console and click the Widget tab there. If everything is working properly, you should see something like this:

If your theme is not Widget enabled, based on the version of Wordpress you have installed, you will find a message there, something like the one shown below.

Now in the same widget error message, there is a link to instructions on how to widget-enable your wordpress template. You can follow the link and read the instructions. Oh yeah, that article may be confusing if you are not okay with PHP or html. Here is another article that may be of help in widget enabling your wordpress template. Check it out.
BUT, BUT, BUT…
Before you try widget-enabling your wordpress theme, getting your hands dirty, you should check whether a new version of the template that you are using is available on the template developer’s website. Of course, this is for those who are using free or premium wordpress templates available on the internet. If you have got a custom template designed, then the solution is already given above. Hope it was helpful.
Search the site
Categories
Recent Posts
- ForestLaneShul: Submit Indian News
- Be a part of the Cocodle Movement
- How to put Adsense ads block after first paragraph in Wordpress Posts
- Computer freezes few seconds before opening any file (Windows XP delay in opening files)
- BSNL JTO Exam 2009 Admit card (Hall Ticket) not received – Whom to contact?
Recent Comments
- Erfo on How to put Adsense ads block after first paragraph in Wordpress Posts
- Majdi on Computer freezes few seconds before opening any file (Windows XP delay in opening files)
- Kwaelbi on How to put Adsense ads block after first paragraph in Wordpress Posts
- Brian on How to put Adsense ads block after first paragraph in Wordpress Posts
- naveed on BSNL JTO Exam 2009 Admit card (Hall Ticket) not received – Whom to contact?


July 19, 2009 in
