I have a posts query that queries posts by ID but want to select those posts by enetering a custom field. Here is the query and where I want to put the custom field:
$query_args = array('post_type'=>'post', 'post_status'=>'publish', 'include' => '483,454, CUSTOM FIELD HERE', 'orderby' => 'date', 'order' => 'ASC');
More info: Custom field is listids and passed in include. But doesn't work.
<?php
&listids = get_post_meta($post->ID, 'list_array', true);
$query_args = array('post_type'=>'post', 'post_status'=>'publish', 'include' => 'echo $listids;', 'orderby' => 'date', 'order' => 'ASC');
$query_posts = get_posts($query_args);
$last_query = end($query_posts);
foreach ($query_posts as $post) : setup_postdata($post); ?>
meta_query
is for. Please search on the site.meta_query (array)
andvalue (string|array)