exclude posts from certain years (2 posts)

  1. rosebean
    Posted 6 years ago #

    I`m wondering if anyone knows of a way to exclude posts from certain years? For example, I want to hide all of my 2008 posts but I don't want to delete them and I don't want to have to manually un-publish each post that was posted in 2008.

  2. MichaelH
    Posted 6 years ago #

    Hide them from where?

    As an example, with the WordPress Default theme, to wp-content/themes/default/index.php you could use the template tag, query_posts(), just before The Loop to display only 2009 posts.

    query_posts($query_string . '&year=2009');

Topic Closed

This topic has been closed to new replies.

About this Topic