Код в настоящее время получает все изображения из медиа-галереи. Я пытаюсь получить изображения из галереи на определенной странице. Как мне этого добиться?
<?php
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'orderby' => 'post_date',
'order' => 'desc',
'posts_per_page' => '30',
'post_status' => 'inherit'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$image = wp_get_attachment_image_src( get_the_ID(), $size = 'full');
echo
"<div class='col-sm-6 col-md-4 col-lg-3'>
<div class='gallery-img-wrap'>
<img src='" . $image[0] . "'>
</div>
</div>";
endwhile;
?>