[fr] Comment exclure une catégorie de la première page de votre blog WordPress tout en la gardant dans les archives.
The simplest method I’ve found up to now (and I’ve only just found it) if there are certain categories of posts you do not want to see appear on your main blog page, but that you still want to see in the archives, is to use query_posts()
.
Here’s an example:
This needs to come in right before the while ( have_posts() ) {
line. The $query_string
parameter means that you can still pass parameters in the URL, so things like special Event Calendar pages will still work.
Careful, though, this only works for one category at a time. You need to use WP_Query
for that, and build a separate loop for the homepage.
Similar Posts:
- WordPress.com Still Messes Up Tags and Categories [en] (2010)
- Events in WordPress [en] (2007)
- Batch Categories 0.9 [en] (2004)
- The Big 2009 Category Revolution [en] (2009)
- Batch Category Editing For WordPress [en] (2004)
- My Categories are a Mess [en] (2006)
- Angst: My Categories are Still a Mess [en] (2008)
- Tags and Categories are not the Same! [en] (2006)
- Requirements for a perfect weblog tool [en] (2003)
- WordPress Finally Has Tags! [en] (2007)
Great to hear you solved your problem! One quiestio, though. How do you manage to get your cutomized twitter on the sidebar? I cant seem to make it work in mi site…
I use this twitter widget http://www.velvet.id.au/twitter-wordpress-sidebar-widget/ and I customized the output somewhat.
THNKS!
Steph, what about using in_category() (or !in_category()) inside The Loop ?
http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category
Seems a bit more usable than resorting to query_posts(), doesn’t it ?