Rick's Daily Tips

Your daily dose of practical, easy to follow tech tips!

  • Home
  • Rick’s Bio
  • Advertise
  • Privacy Policy
  • Rick’s Tip Jar
  • Get My Tech Tips Newsletter
  • Contact Me
You are here: Home / Blogging Tips / Q&A: How can I display Google Adsense ads only on individual posts using Genesis Simple Hooks?

Q&A: How can I display Google Adsense ads only on individual posts using Genesis Simple Hooks?

Posted on February 24, 2014

adsense-logoQuestion from Harlan F.:  I have a problem Rick, and I’m really hoping you can help me solve it.

I have a WordPress blog that uses the Genesis Framework and the Genesis Simple Hooks plugin to display ads on my blog. I pasted my Adsense code into the genesis_after_content hook in order to have an ad displayed at the end of every post (and page).

It works great, but the problem is it also displays an ad after every post snippet on the home page. As you probably know, this is a big no-no since Google limits us to three Adsense ads per page.

My question is how can I get Simple Hooks to display an Adsense ad at the end of each post without also displaying them on the home page?

Rick’s answer:  You’re right about the Adsense program’s three ads per page rule Harlan, and you’re wise to avoid going over that amount. Luckily, it’s very easy to have the Genesis Simple Hooks plugin place your ads only on individual posts and pages. Here’s all you have to do:

1 – As before, find the genesis_after_content hook and paste in your Adsense code.

2 – Paste this code snippet on a blank line immediately before the beginning of the Adsense code:

<?php if(is_singular()) { ?>

3 – Paste this code snippet on a blank line immediately after the end of the Adsense code:

<?php } ?>

The code inside the box should now look like this:

<?php if(is_singular()) { ?>
<p>your-adsense-code-here</p>
<?php } ?>

4 – Check the box beside “Execute PHP on this hook?”.

5 – Click the Save Changes button.

From now on you should see an Adsense ad displayed after each post and on every page. But you should not see them on the home page, the category pages, or any other pages that display multiple posts.


Do you have a tech question of your own for Rick? Click here and send it in!






Popular…

How do I ask you a tech question?

Step-by-step guide to completely ridding your PC of viruses and other malware

10 reasons why I recommend buying tech gear from Amazon

How to upscale video – Top 4 AI video enhancers in 2023


Advertise

Guest Post Guidelines

Want to ask me a tech question?

Handy Tech Resources

Privacy Policy

Computer Tips
Smartphone Tips
Blogging Tips

Tech Q & A
Reviews
Tech News

Write for RicksDailyTips.com

Scam alerts
Downloads

Copyright © 2025 RicksDailyTips.com

Affiliate Disclaimer


Rick's Daily Tips is hosted by InMotion Hosting. Click here to find out why.