<?php
global $redux_demo;
$page_id = $redux_demo[input_id];
$query_page = new WP_Query(array(
'post_type'=>'page',
'post__in'=>array($page_id)
));
?>
its show just single page, not multiple pages.
var_dump($page_id); // output '192, 185, 188, 150' // include = 'punctuation'
if manual input = array(192, 185, 188, 150) show selected pages.
How can I fixed this problem $page_id
???
The post__in
parameter expects an array
of IDs, and you're passing it a string
(see WP_Query - Post & Page Parameters for more details.
So, you need to convert $redux_demo[input_id]
into an array first:
global $redux_demo;
// Convert input into an array, and remove whitespaces
$page_id = array_map( 'trim', explode(',', $redux_demo['input_id']) );
$query_page = new WP_Query(array(
'post_type' => 'page',
'post__in' => $page_id
));
Also, it seems you're missing some quotes here: $redux_demo[input_id]
. Shouldn't it be $redux_demo['input_id']
instead?