passing multiple parents value into a shortcode

If you’re passing in a comma-delimited list of parent IDs when you call the shortcode, it’s pretty easy to turn this to an array.

For example, using [scname parent="5,10,15"]:

function andrew_child_loop_shortcode_new ( $atts ) {
    global $post; $thePostID = $post->ID;

    $atts = shortcode_atts( array(
        'posts'  => 20,
        'parent' => $thePostID
        ), $atts );

    // Turn the 'parent' parameter into an array
    $atts[ 'parent' ] = explode( ",", $atts[ 'parent' ] );

    extract( $atts );

    // ... now do whatever you were going to do ...

}

Now your $parent variable is an array of the post IDs passed in. If only one was passed in, it’s array with a single element. If you passed in multiple IDs, then you’ll have an array with multiple values.

How you construct your queries and move on from here is entirely up to you …