$attachments = get_posts( array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
) );

if ( $attachments ) {
foreach ( $attachments as $attachment ) {
?>
  • ID, 'full' ); ?>

    post_title ); ?>



  • }
    }
    endwhile; endif;


    KAYNAK:
    https://developer.wordpress.org/reference/functions/wp_get_attachment_image/