CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
Other Discussions
Problem when trying to will posts from a category in wordpress
akurtula
Permalink to comment
#
August 2012
Hi
I am trying to hide posts which have a specific category. To do this, I am doing:
<?php query_posts('cat=-307'); ?>
<?php while ( have_posts() ) : the_post(); ?>
....
It works great, but then if I try to view posts from a specific category e.g ".../category/jquery" i get all the posts.
when I remove the first line from the code above, and try to filter posts by category (any category) it works fine.
Is there a way to solve this problem.
I am using the boilerplate theme so the rest of the code is fine.
Thanks
Add a Comment
I am trying to hide posts which have a specific category. To do this, I am doing:
It works great, but then if I try to view posts from a specific category e.g ".../category/jquery" i get all the posts.
when I remove the first line from the code above, and try to filter posts by category (any category) it works fine.
Is there a way to solve this problem.
I am using the boilerplate theme so the rest of the code is fine.
Thanks