[wp-hackers] get_posts and new wp_query at same place and custom field

Diana K. Cury dianakac at gmail.com
Sun Feb 19 19:06:35 UTC 2012


Hello,

I have a modified category.php using get_posts and new wp_query, not really if this is right.

get_posts() is getting and listing posts with meta_key and orderby meta_value etc working fine.

new wp_query get posts as usual but I'm trying to exclude the ones with empty meta_value. I tried everything and that just don't works. If I set to get a post with meta_value=2, works ok, but no meta_value='' or the _wp_zero_value, or meta_compare.

Maybe is not right to use get_posts and wp_query at same time?! The paginations is working, maybe that doesnt work together?!

Clarification:

I'm creating a theme for manage chapters, every category manage posts as usual and chapters if there is any chapter value. I need to list chapters and posts at same time but not all at the same listing stream.


More information about the wp-hackers mailing list