How to exclude a post that has empty custom field (for example “slides”) from the wordpress loop?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use meta_query in your Wp_query like this:
In this example they are only showing posts where the custom field “color” doesn’t have the value “blue”
See this page: http://codex.wordpress.org/Class_Reference/WP_Query and scroll to the “Custom Field Parameters” section.