How to exclude meta_key from query_posts?
-
Hi!
I’m making a page template where I use a custom field to set a post as featured at the top of the page (in this case meta_key=getactive). I want the rest of the posts in that category to appear underneath, excluding the post I just featured.
I looked everywhere online and in the codex, but there doesn’t seem to be a way to exclude posts with a meta_key value when calling posts from a category using query_posts.
Here’s the code I used to call the feature post:
<?php query_posts(‘meta_key=getactive&meta_value=yes’); ?>
And here’s what I’m using to call the category, where I’d like to exclude the post I just called:
<?php query_posts(‘category_name=Get Active&showposts=10’); ?>
Anyone know how to do this?
Cheers!
- The topic ‘How to exclude meta_key from query_posts?’ is closed to new replies.