I have the following code:
global $post;
$current_post = $post->ID;
$array=range(1,$current_post);
$posts = get_posts('numberposts=5&post__in=' . $array . '&category='. $category->term_id . '&exclude=' . $current_post);
The error appeared is Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/todaytra/public_html/depmua/wp-includes/query.php on line 2159
Could any one point out the mistake with my $array valiable?
Thanks for any help :)
$current_post? – imHavoc Oct 27 '12 at 6:00$current_post? – userabuser Oct 27 '12 at 7:06echo $current_postit gives213629. Without thepost__inargument i get nicely 5 posts, some have id larger than 213629, some smaller. By the way, i don't have too much posts (i deleted a lot of post revisions and drafts, that's why i have that big ID) – Pam Apple Oct 27 '12 at 7:15