Forums

post_parent (3 posts)

  1. kikko088
    Member
    Posted 1 year ago #

    hi at all, i have a little problem,
    $myposts = get_posts('post_parent=1&post_type=page&orderby=rand&numberposts=1');

    with this code i display a random subpage of a mother page, all OK, but if I put another mother page
    $myposts = get_posts('post_parent=1,2,3&post_type=page&orderby=rand&numberposts=1');
    nothing, the code display a casual page of other mother page...

    where is the mistake?
    tank at all
    kikko088

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    i assume from reading the docu that post_parent can only take one id as argument:

    $post_parent
    (integer) (optional) Show only the children of the post with this ID
    Default: None

    http://codex.wordpress.org/Template_Tags/get_posts

  3. kikko088
    Member
    Posted 1 year ago #

    :( thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic