Show Attached Image to Post on WordPress olatechproFebruary 11, 20232 Views How i can show attached images of my posts on WordPress? Post Views: 2 Related postsGet rid of this Strict Standards warningWooCommerce: get_current_screen not working with multi languageCan’t login on WordPressForce HTTPS using .htaccess – stuck in redirect loopWordPress: Ajax not working to insert, query and result dataHow Can I pass an image file to wp_handle_upload?
Try this in your single.php template: $args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $post->ID ); $images = get_posts( $args ); foreach($images as $image): echo wp_get_attachment_image($image->ID, 'medium'); endforeach; Log in to Reply
Try this in your single.php template:
wp_get_attachment_image