[Resolved] query posts by post ID variable
Hi really struggling with something I thought would be quite straightforward and hoping that some one can help…
I essentially need to query posts by a list of post ID which are stored and then retrieved in a custom table in my database.
<?php $block = $wpdb->get_results( "SELECT sid FROM wp_entries WHERE uid = '$current_user->ID'" , ARRAY_N); print_r ($block); $args = array('cat' => 8, 'showposts' => 3, 'post__not_in' => array($block) ); $category_posts = new WP_Query($args); if($category_posts->have_posts()) : while($category_posts->have_posts()) : $category_posts->the_post(); ?>
Unfortunately all i’m getting back for this is the printed array …
Array (  => Array (  => 835 )  => Array (  => 832 )  => Array (  => 823 ) )
But the posts are still displaying??
Im fairly sure that i’m missing something fundamental but have no idea where to start.
Thank you in advance for any help
- The topic ‘[Resolved] query posts by post ID variable’ is closed to new replies.