Hide Sidebar on Date-based Archives: How To do This on WordPress

StevenWordPress

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 date-based archive pages.

To hide your sidebar on your date-based archive 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:

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

<?php if(!is_year() || !is_month() || !is_day()) {
  get_sidebar();
} ?>

You’re done! Your sidebar will be displayed on all your blog pages except date-based archive pages.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

No thanks, I have enough money