If you have posts and pages then page_id
isn’t the correct parameter. You should probably use post__in
. See WP_Query Parameters
.
Additionally, post__in
accepts an array, whereas you have a string, so you’ll need to use PHP to explode
the string into an array.
This is untested, but I think it should do it:
$ids="7,43,20,22,16,1051,18,26,9,24,28,10523";
$ids = explode(",", $ids);
$page_query = new WP_Query( 'post__in' => $ids, 'nopaging' => true );
nopaging
should do it, or "posts_per_page" => -1
if it doesn’t.