• hello.
    i am pretty close to figuring this out, but i’ve come up against a brick wall.

    i am trying to retrieve a number of posts, by post_ids only.
    e.g. i want to display posts 1,5,24,32 and 48

    i have already collected the post_ids into a variable
    e.g. $posts = ‘1,5,24,32,48’;

    and i am trying to print them out using this:
    query_posts(array(“post__in” => array($posts)));

    but it only ever prints out the first post.

    is there a different line that you have to use to get it to print out all the posts listed in the variable?

    thanks for your help!

Viewing 1 replies (of 1 total)
  • >>$posts = ‘1,5,24,32,48’;<<

    You can’t set up a variable like this. 1 varibale = 1 thing. If you want 1 variable to be a list of things, you have to set it up as an array.

    Since I dont’ know your code, then the best suggestion i can offer is:

    $post1 = “1”;
    $post2 = “5”;
    etc.

Viewing 1 replies (of 1 total)
  • The topic ‘how do you retrieve lots of posts, by their post_id’ is closed to new replies.