Jeet Blog

About Us

  • About
  • FAQ
  • Contact
  • Archives
  • Send Us Tips

Subscribe

RSS Stay up to date with RSS

Or by email:

Search

× close
Add to Technorati Favorites

Join Jeet Blog Community

Official SOB

How To- Remove Ads on Posts in Certain Categories in Wordpress

3

Jun

If you are a blogger who covers various topics under different categories and uses ad networks like Google Adsense, then you may sometimes want to remove ads from certain post categories.

So here is the code ( thanks to Keith and John ) which lets you remove ads from certain categories in Wordpress:-

<?php
if ( !in_category(5) && !in_category(10) ) {
?>
Your ad code here
<?php } ?>

In the above code, the number in brackets is the category id.

Finding Category ID in Wordpress 2.5

If you are using Wordpress 2.5 then to find the category id, just go to manage categories and then hover your mouse over a particular category and look at your browser status bar. You can find the category ID there.

wordpress-categories

And thats how you find the category id in WP 2.5 . We hope this technique helps you to manage ads on your blog in a better manner.

Enjoy this post? Subscribe to our RSS feed!
Filed in Blogging, How To Tutorials
9 Comments.

Share or Bookmark the Post


Reader Comments


  • GirlPie
    // June 4th, 2008
    1

    Great tip,
    and I just subbed in RSS and love-love-love your blog so far — my reader gives me the last 10 posts and they’ve inspired my to start down your list of categories — very useful, clean, clear, simple; thanks.

    (Your commas and their spacing is all messed up in Firefox, but I’m guessing you’re typing fast with all your good ideas flying out of your brain, so I mention it just FYI.)

  • Buzzurls
    // June 4th, 2008
    2

    great!

  • Abhijeet
    // June 4th, 2008
    3

    Thanks Girlpie and Buzzurls

    Girlpie- Could you send me the screenshot of the page?..Even I am using Firefox and the commas and spaces appear fine to me.

  • GirlPie
    // June 4th, 2008
    4

    Can’t send screen shots but I have a SnagIt jpg that I’ll email to you — just look at your ABOUT JEET BLOG info to the lower-right of these comments: the ellipses (the three dots, not really used correctly here — it’s NOT a “pause” — but it’s passable) needs a space after it;
    the first period ending the first sentence needs a space after it and before the “This”;
    the comma between “tips,online” and the next tree uses need to have a space after the comma (to look like “tips, online”);
    and the last ellipses has an incorrect space before it, and is only two dots when it should be three. And you should have the two words “Read More” on the same line.

    I wasn’t commenting on this particular post, (which also has some mistaken punctuation) but on the proofing job as a whole. Your content and overall look is so good, I just think you need a professional proofer so you can keep focused on the content! I’ll send the jpg in a sec… just gotta get your email –

  • GirlPie
    // June 4th, 2008
    5

    Will email privately –

  • GirlPie
    // June 4th, 2008
    6

    Doh! The long comment didn’t go through so I thought better of it and deleted it to send privately and now I see it did go through — again, with all due respect… it’s just about the proofing, not the swell content.

  • Abhijeet
    // June 4th, 2008
    7

    @GirlPie- Got your email and replied to it. Thanks for noticing. :)

  • ajay@Readerszone
    // June 5th, 2008
    8

    jeet thanks for this tip.
    is it work with wordpress 2.3?

  • Abhijeet
    // June 5th, 2008
    9

    @Ajay- it works with all versions of wordpress

Leave a Comment

Popular Posts

  • Incredible Firefox Keyboard Shortcuts Which You Probably Don’t Know About
  • 5 Power Tips For StumbleUpon Users
  • Handling Criticism As A Blogger- My Thoughts
  • 5 Weird And Hilarious Google Search Results
  • Simplest Trick To Shut Down Windows In Under 5 seconds
  • 7 Incredible Tools To Browse Flickr Photos
  • Methods To Manage Multiple Gmail Accounts
  • Using Trends In Google Reader To Manage RSS Overload
  • Innovative Ways To Get Post Ideas When you Face Writer’s Block
  • 3 Useful Methods to Back Up Your Firefox Preferences
  • 10 Reasons Which Make Digsby the Coolest IM Client

Categories

  • Blogging
  • Firefox
  • Gmail
  • Google
  • Google Reader
  • How To Tutorials
  • Interesting
  • Internet Tools
  • Jeet Blog
  • Life
  • linux
  • Online Tips
  • Productivity
  • RSS
  • Security
  • Social Networking
  • Software
  • Technology
  • Uncategorized
  • Windows Tips

Return to top ^

Latest Posts
  • Download ZoneAlarm ForceField FREE For Today
  • Automatically Backup Your Firefox Profile To Box.net With FEBE
  • KYPS Protects Your Passwords From Keyloggers
  • Hide Your Secrets In Reef Stash Sandals
  • Six Best Firefox-3 Add Ons For Images
  • Jeet Blog Now Has PR 5 !
Community
About Jeet Blog
My name is Abhijeet Mukherjee and I am the author of this blog. This blog is about tech tips, online tools, productivity, blogging and ways to organize your life in a better manner. Read More
Join me elsewhere:
MyBlogLog - FaceBook - Friendfeed - Twitter - Orkut - Digg - StumbleUpon
© Copyright 2008 Abhijeet Mukherjee // Disclaimer and Privacy Policy // Design by Pro Blog Design