Forums

[resolved] query_posts: retrieve only certain posts (3 posts)

  1. fenomenon_79
    Member
    Posted 5 months ago #

    Hi,
    I couldn't find how to use query posts to retrieve certain posts by ID.

    This only show last post which isn't ID 1 nor 2 nor 3:
    query_posts('p=1,2,3');

    This retrieve last 3 posts, which aren't 1 nor 2 nor 3:
    query_posts('p=(1,2,3)');

    I appreciate any kind of help.
    thanks.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

  3. fenomenon_79
    Member
    Posted 5 months ago #

    Thanks esmi.

    It worked by merging that 2 functions:

    query_posts(array( 'post__in' => array(1,2,3) ))

    Cheers.

Reply

You must log in to post.

About this Topic