Hopefully a simple query question
-
Trying to display a custom field value from a custom post type at random on page load. My query works, but because each post has an empty value for the custom field, sometimes on page load the spot for the custom field value appears to be blank.. I want it to ONLY grab custom field values that actually has text in it… here is my quer
$quotequery = new WP_Query( 'post_type=knowledgebase&meta_key=pull_quote&showposts=1&orderby=rand'); if ( $quotequery->have_posts()) { while ( $quotequery->have_posts() ) { $quotequery->the_post();
Thoughts on how I can limit this to only show posts that actually have a value in the pull_quote custom field?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Hopefully a simple query question’ is closed to new replies.