No Ads for Regulars

When I get time.

No Ads for Regulars at Binary Bonsai
I think I originally got this code off of Matt, and now here it is for you to use. All this does, is check to see if the current page is a permalinked entry and if the person visiting has a cookie from leaving a comment.

If it is a permalink and the user doesn’t have a cookie, they get an ad.

global $cookiehash;
if ((is_single()) and (!isset($_COOKIE['comment_author_'.$cookiehash]))) {
Google Ads can go here…
}

It requires WordPress of course, but other than that it’s easy peasy.

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • That sounds very viewer-friendly.

    FYI: I have my FF set to not accept cookies unless I okay them first but I do occasionally need to accept cookies before leaving a comment. Even then, I delete the cookie immediately after the comment is accepted so this wouldn't be directed to others that do the same (or block ads of course via GM etc.) but it does sound user friendly for those sites that have ads buit don't want to push it on their regular viewers (which in itself is a weird concept... why have ads then?).
blog comments powered by Disqus