I need to use a variable in the below code but it doesn't work, I don't understand why.
Working code;
$the_query = new WP_Query( array(
'post__in' => array(
16405,16362,16290,16434,16661
),
) );
Code that doesn't work;
$featured_content_id = get_theme_mod( 'laura_featured_content_id' );
$the_query = new WP_Query( array(
'post__in' => array(
$featured_content_id
),
) );
When I look at $featured_content_id variable using echo and var_dump(), it seems to be correct. Which means the result is 16405, 16362, 16290, 16434, 16661 but it doesn't work inside a array. Also it doesn't work if I directly use $featured_content_id = '16405, 16362, 16290, 16434, 16661'. Do I have to write it inside array?