Want Extra Money?

A few years ago, I went completely bankrupt. Since then, I have been able to make a small fortune online.

Subscribe to my email list, and I will share everything I know with you. No secrets. Ever.

Make Money OnlineSEOMotivational QuotesBloggingWordPressReviewsTraffic GenerationInternet MarketingInternet LifestyleGeneralList BuildingIncome ReportsWho isAbout Dukeo
Dukeo » WordPress » Hide Sidebar on Category Pages: How To do This on WordPress

Hide Sidebar on Category Pages: How To do This on WordPress

Steven Jun 28, 2012 4 responses WordPress

Your WordPress blog sidebar is an essential element of your blog, however, on some occasions you might not want it to be displayed on your blog category pages.

To hide your sidebar on your category pages, edit the archive.php file from your theme (if your theme doesn’t include this file, edit the index.php file) and look for the following snippet of code:

<?php get_sidebar(); ?>

and replace it with:

<?php if(!is_category()) {
} ?>

You’re done! Your sidebar will be displayed on all your blog pages except your blog category pages.

If you enjoyed this article,
Get email updates

Join for Free ▶


  1. Ivin

    Thanks Steven. I love WordPress hacks, they are essential for customization and it’s difficult to find info like this.

    Sometimes, you can find themes that have these hacks worked into them for customization too.

    1. David

      Ivin, where do you look for customized themes when you need them?

  2. David

    That’s a cool trick. I wasn’t aware of the: if(!is_category()) – part, thanks for sharing that

  3. Joseph

    Wow! That’s quick.

Real Time Web Analytics