I'm using a custom meta box to output a list of post IDs within a particular post type ("Publications" in this example). Is there a way I can output this array into a custom loop to only show posts with those ID's?
This is the code I am using;
Meta box array
$related = get_post_meta( get_the_ID(), 'ps_related-publications', false ); foreach ( $related as $meta );
$related_publication_widget = new WP_Query( array ( 'post_type' => 'publications', 'p' => $meta, 'posts_per_page' => '-1', ));while ( $related_publication_widget->have_posts() ) : $related_publication_widget->the_post();
Because the ID's are output as just numbers (Ie; without the ',' required to separate ID's in a query, it's only showing the latest post as oppose to all of them as defined in the loop.