Remove Kontera by modifying templates.

Yesterday, I explained how to keep Kontera ads out of your articles by manually adding tags everytime you write an article. Today, I’ll show you how to modify your template so you don’t need to remember to insert the pesky ads every time.

Here’s how to, in three ‘easy’ steps:

  1. Create a category for your sponsored articles. You can call it whatever you like. After you created it, go to the dashboard, and visit Manage=>Categories to determine the number of that category. (The category for my sponsored ads is 12.)
  2. Modify your main and archive templates as shown below. Tweaking will be required because templates vary.
  3. Once the template is modified, always place all your sponsored articles in the sponsored category.

How to modify your template

To set up your template, you need to use an “if/else” statements to wrap <span name=”KonaFilter”></span> around the content of sponsored posts; wrap <span name=”KonaBody”></span> around the content of other posts.

Here is a bit of example code showing where to place the ‘if/else’ statements relative to the cotent. In my example ’12′ is the category number for my sponsored posts; change that number to match the category for your sponsored ads.
— code starts here-
<?php
// The following if and else statements insert the first part of the span tags.
// These are the tags you want in the article.
if (in_category(12) ) {echo(‘<span name=”KonaFilter”>’);}
else {echo(‘<span name=”Konabody”>’); }
?>

<h2 class=”title”><a href=”<?php the_permalink() ?>”
rel=”bookmark” title=”Permanent Link: <?php the_title();
?>”><?php the_title(); ?></a></h2>  
 
    <?php the_content(); ?>    
    <div class=”posted”><?php the_time(‘M d Y
h:i a’); ?> |
    <?php the_category(‘ and ‘);?> |    
    <?php comments_popup_link(‘No Comments
»’, ’1 Comment »’, ‘% Comments »’);
?><?php edit_post_link(‘ | edit this’); ?>
    </div>
<!- this closes the span tag->
</span>;
<!- this sets a NEW tag and keeps ads out of the comments. ->
<span name=”KonaFilter”>
<?php comments_template(); ?>
<?php echo(‘</span>’); ?>

--- code ends here--

This code should do the trick for you! Of course, tweaking may be required because the guts of your template will look different, but this should give you a head start.

5 Responses to “Remove Kontera by modifying templates.”

  1. Big Bucks Blogger » Keeping Kontera out of Sponsored Ads: Easy Method says:

    [...] you’d like to know how to do that, ask and I’ll post more detail. (Update: How to block Kontera Ads.) May 15 2007 10:55 am | Monetize and Kontera [...]

  2. Tricia says:

    I don’t use Kontera - I just don’t like the look of those ads, but I’ll remember your post the next time I see someone having difficulty with Kontera.

  3. Derrich says:

    Good post. Thanks for the suggestion. I thought I did everything possible to eliminate the Kontera ads from my reviews. Hopefully this will do the trick.

  4. Jimi says:

    I have to try this way too. I put the “span” tags in some posts after they got “rejected” for having Kontera ads and some deleted them, while others still showed the ads even with the “span” tags. Worked on only about half the posts I put the code into.

  5. Derrich says:

    Yeah. It’s really weird. I don’t plan adding Kontera back to my blog anytime soon.

Leave a Reply