• About
  • Archives
  • FAQ
  • Blog
  • Facebook
  • Twitter
  • Contact
  • Home
  • Articles
    • Affiliate Marketing
      • Affiliate Networks
      • Affiliate Programs
      • Google Adsense & More
      • Merchants & Managers
    • Build Your Site
      • Blogging
      • Design Tips
    • Content is King
    • Find Your Niche
    • Get Traffic
      • Article Marketing
      • Email Marketing
      • Pay Per Click Advertising
      • Search Engine Marketing
      • Social Networking
      • Video Marketing
    • Learn to Sell
    • Manage Your Money
    • Other Bizops & Jobs
    • Sell Your Own Product
    • Success Tips
    • Videos
  • Beginners
  • News
  • Polls+
    • Contests
    • Just for Fun
    • Polls
    • Ros' Personal Notes
  • Resources
    • Deals & Discounts
    • Tools
      • Affiliate Tools
      • Content & PLR Sources
      • Datafeed Tools
      • Keyword Tools
      • List Building Tools
      • PPC Tools & Services
      • Productivity Tools
      • Site Tools
    • Training
      • Ros' Speaking Agenda
      • Seminars & Webinars
      • Tutorials
  • Reviews
  • Tags
    Written by Rosalind Gardner  

    Print Print  Email Email  1 Comment

    How to Exclude a Blog Category from Displaying

    Have you ever wanted to exclude a particular category from a section of your blog without using a plugin?

    For example, because there is already a separate list of videos on the homepage at RosalindGardner.com, I didn’t want the videos to show up again in the “Most recent entry posted” featured at the top of the page.

    So, to eliminate the Videos category from that section, I first look go to Manage > Categories in my Wordpress Administration panel and look for the category ID, which turns out to be #10.

    I open the home.php template (you might be using index.php) and add cat=-10 to the code for the most recent post as follows:

    < ?php $recent = new WP_Query("showposts=1&cat=-10"); while($recent->have_posts()) : $recent->the_post();?>

    Note the minus sign in front of the category number.

    If you want to eliminate more than one category from the display, simply separate each category ID number with a comma, such as: &cat=-10,-22 .

    [tags]blog, wordpress, category, exclusions[/tags]

    Rosalind GardnerWant more info?

    Rosalind Gardner is a Super Affiliate blogger, author, speaker, and Internet marketing consultant.

    If you enjoyed this article and want to be notified the next time Rosalind writes something, subscribe to her RSS feed or the No-Hype, No-BS, No Spam NPT newsletter. You can also follow her on Twitter and Facebook. Thanks for visiting!


    Related Posts

    1. Create a Unique Site Map for Your Wordpress Blog
    2. Just Added the Simple Recent Comments Plugin
    3. Clickbank Marketplace Category Refinements
    4. Technorati Tagging Made Simple
    5. Is Your Blog Featured On Facebook?

    Posted / Revised on March 14, 2008 under Build Your Site
    Tags:

    Comments

    One Response to “How to Exclude a Blog Category from Displaying”
    1. Michael Chalke says:
      Saturday, March 15, 2008 at 9:19 am

      Dear Rosalind, First I hope yopu are on the mend and getting over your traumatic surgery. Good Luck.xxx
      Second is that I have liked all the good things coming my way from you, but am surprised to see and unfortunately buy (£39.99) the programme on your blogsite.
      Namely “How I earn £14,246 a week”. This is a con for hard up pensioners like me. It’s a Gambling programme primarily, and betting against a Roulette Wheel and Football results. A Game of chance which I am sure will loose a lot of money if you followed it. I think he is also reselling with no Rights. I have asked for a refund.
      Thought you might like to know and perhaps check him out.
      Regards Michael Chalke.

    Subscribe to Rosalind Gardner's Internet Marketing NewsFREE Subscription

    Recommended

    The Super Affiliate Handbook

    Quick Links

    Menu

  • About Rosalind Gardner
  • Books by Ros
  • Common Questions and Answers
  • Consultations (1-Hour)
  • Consultations (10-minute)
  • Free Newsletter
  • Glossary of Terms
  • Site Archives
  • Speaking Agenda
  • Support
  • Categories

    • Categories
      • Articles (683)
        • Affiliate Marketing (259)
          • Affiliate Networks (17)
          • Affiliate Programs (78)
          • Google Adsense & More (20)
          • Merchants & Managers (26)
        • Build Your Site (119)
          • Blogging (50)
          • Design Tips (35)
        • Content is King (26)
        • Find Your Niche (62)
        • Get Traffic (142)
          • Article Marketing (13)
          • Email Marketing (18)
          • Pay Per Click Advertising (39)
          • Search Engine Marketing (11)
          • Social Networking (28)
          • Video Marketing (5)
        • Learn to Sell (10)
        • Manage Your Money (9)
        • Other Bizops & Jobs (28)
        • Sell Your Own Product (12)
        • Success Tips (62)
        • Videos (14)
      • Beginners (54)
      • News (74)
      • Polls+ (67)
        • Contests (12)
        • Just for Fun (12)
        • Polls (6)
        • Ros' Personal Notes (34)
      • Resources (262)
        • Deals & Discounts (8)
        • Tools (81)
          • Affiliate Tools (7)
          • Content & PLR Sources (21)
          • Datafeed Tools (6)
          • Keyword Tools (11)
          • List Building Tools (4)
          • PPC Tools & Services (4)
          • Productivity Tools (7)
          • Site Tools (20)
        • Training (156)
          • Ros' Speaking Agenda (25)
          • Seminars & Webinars (83)
          • Tutorials (58)
      • Reviews (34)

    Popular

  • CMS, Blogs, Websites & Website Builders
  • Cut Your Writing Time in Half
  • It's GOOD to Be a Thin Affiliate
  • 11 Ways to Make Money Online
  • Recession-Proof Products for Affiliates
  • Overcome Writer's Block
  • How to Sell WITHOUT Selling
  • Recommended

  • Autoresponder Services
  • Content Suppliers
  • FREE Blog Setups
  • Site Hosting Services
  • Super Affiliate Training
  • Website Builders
  • Wordpress in a Day
  • Wordpress Themes
  • Follow Ros

    For quick news updates, follow Ros on Twitter, Facebook

    • Recent Posts

      • Free CPA Advertiser Webinar with Jim Lillig
      • WP Shopping Pages Plugin for Affiliates
      • Thesis Theme for Wordpress: An Overview
      • Yahoo! Storm Approaching
      • National Broadband Plan for the U.S.
    • Affiliate Blogger PRO News

      • New Quizzes and Product Review Examples
      • Mind Your P’s Q’s and Squirrely Brackets
      • How to Quickly Place Amazon and eBay Product Listings on Your Blog
      • Advertising Tax News Resource
      • How Much is My Blog Worth?
      • Who Links to My Site?
      • Is My Site Listed on Google?

    Copyright © NetProfitsToday.com 2009 · All Rights Reserved
    · Terms of Use · About · Books · Services · Contact·

    This blog is powered by StudioPress themes for Wordpress and Aweber