Kontera & PPP Hack
Do you want to run Kontera ads? Do you also want to run sponsored posts from companies like “Loud Launch” and “Pay Per Post” too? Are you having trouble figuring how to prevent the Kontera ads from displaying in the sponsored posts?
Well, I figured out two ways to do it. Today, I’ll describe the way that works most easily with the template I use at my diet blog. You can see how it works at my non-sponsored and categories of my diet blog.
You too can run Kontera ads but supress them on the selected pages. That is, you can do this if you run Wordpress (or Moveable Type or any blog software that lets you fiddle with the code. Modest PHP skills are required. (If you don’t know any php, have someone help you. Otherwise, you are sure to add php tags where they don’t belong or miss them where they do belong. This will screw up everything and you won’t know why.
Now, how to modify to run Kontera ads when you also run sponsored ads in a few easy steps.
- Start by modifying a blog page where Kontera ads already display. It doesn’t take long for the Kontera ads to display, but if they don’t already display, you won’t be able to check whether or not this hack worked for you.
- Create a “Sponsored” category. You can call it whatever you like, “buzz”, “ppp”, ‘no kontera ads’ or anything you like. Put all sponsored posts in that category.
- Go to the category editing panel in Wordpress. Look up the category number for your sponsored posts. The category number for my sponsored posts is 12. Write that number down.
- In the theme editor, identify the page templates you use in your blog. You should have a Main Template and possibly an archives template and individual posts templates. You’ll want to modify each, but you must do so one at a time.
I recommend beginning with the template for individual pages. Back up the template because you are about to modify it. (Or practice doing modifying the template at a practice blog you installed for fiddling with hacks.)
Open the individual posts template. Inside the template, look for the bit of code that initiates “the loop” that display the individual posts. It may be a “while” structure, or it may have a “foreach” type structure”. The first line of the while loop at my diet blog looked like this:
This bit of code finds each blog post that fits the criteria for a display page. It will be followed by a whole bunch of other lines that organize your post display.
You need to add one line somewhere inside the loop. That line looks like this:
Before you add this line though, change the number “12″ to match the number for your sponsored categories. (You wrote it done, right?) Now, save the mods.
View your page to make sure it display. Nothing should have changed.
Now, modify the footer by adding this bit of php code:
View some individual pages. When you view pages with no sponsored ads, you should see the Kontera ads. When you view pages with sponsored ads, you should see no Kontera ads.
Now, repeat for your main template pages and any archive templates. Check each display after you have finished. When this is working, Kontera ads will not show if even one entry on a page is sponsored. Otherwise, the ads will show.
I hope all your money making blog schemes work for you! Tomorrow I’ll describe how to run the Kontera ads and PPP ads at a blog with a more efficiently designed template like the one I use here.
This entry was posted
on Tuesday, May 8th, 2007 at 9:04 am and is filed under Blog Hacks, Kontera, Monetize, WordPress.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.