I want to dislay wordpress gallery in single.php. I put this code into single.php
<?php echo do_shortcode('[gallery columns="4" ids="1,2,3,4,5,6,7,8"]');?>
The problem is that image ids are changing based on post ID.
I wonder what code should I put? I did:
<?php
$id_image = what_code_should_i_put_here;
echo do_shortcode('[gallery columns="4" ids="'.$id_image.'"]');
?>
But I have no idea the code part.
what_code_should_i_put_here
must result '1,2,3,4,5,6,7,8'