query_posts if meta_value != ”
-
I’m trying to get all posts that have the meta_key ‘imgs’ AND have a meta_value for ‘imgs’ that is not nothing. I’ve tried meta_value = (with nothing following it as seen below), meta_value=False, meta_value=false, meta_value=empty and meta_value=0. Nothing works. I keep getting back posts that have a blank value for the custom field: ‘imgs’. Thanks in advance!
<?php query_posts('&meta_key=imgs&meta_compare=!=&meta_value=&orderby=rand&showposts=10'); if (have_posts()) : while (have_posts()) : the_post(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘query_posts if meta_value != ”’ is closed to new replies.