<?php query_posts( ‘post__not_in=array(264)&post_type=page&posts_per_page=100&orderby=menu_order&order=asc’ ) ; ?>
Thanks for the reply.
When I use that code I get these error messages:
Warning: array_map() [function.array-map]: Argument #2 should be an array in /nfs/c08/h03/mnt/122148/domains/missionbombshell.com/html/wp-includes/query.php on line 2104
Warning: implode() [function.implode]: Invalid arguments passed in /nfs/c08/h03/mnt/122148/domains/missionbombshell.com/html/wp-includes/query.php on line 2104
Any idea what’s going on?
From http://ww.wp.xz.cn/support/topic/how-to-extract-post-ids-from-an-array?replies=10
I’ve just checked the post__not_in function and it appears to accept post ids without single quotation marks, so that’s not the issue.
When I put in:
‘post__not_in’=>array(555,553,152,46);
it excluds the posts. But when I replace that with:
‘post__not_in’=>array($mypostids);
it doesn’t work, even though $mypostids printed is 555,553,152,46 exactly.
it might be the best if you rewrite the line:
<?php
$args = array(
'post__not_in' => array(264, 234),
'post_type' => 'page',
'posts_per_page' => 100,
'orderby' => 'menu_order',
'order' => ASC
);
query_posts( $args ); ?>
Thanks for this help.. I’ve been trying for a day to get a 4-loop front page to work. The code I used for my queries looks like this
<?php $lead_post_query = new WP_Query( array ('post__not_in'=> $do_not_duplicate, 'showposts'=>'1'));
while ($lead_post_query->have_posts()) : $lead_post_query->the_post();
array_push($do_not_duplicate, $post->ID) ?>
The key is to make a single array called $do_not_duplicate with already published posts.
Then use post__not_in to filter your nest query.
Then amend new IDs to $do_not_duplicate with array_push.