You can use this to identify the attachments in a post:
$args = array(
'post_type' => 'attachment',
'post_parent' => $post->ID
);
$images = get_posts($args);
foreach($images as $image){
echo wp_get_attachment_image($image->ID, 'size')
}
Related Posts:
- Delete the original big size image after upload and leave only 3 images crunched by media gallery
- Populate a drop down list with post titles across a multisite network
- simply loop through posts
- Difference between an archive and a page listing posts
- Post preview mechanism architecture
- WordPress Queue like Tumblr?
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Moving WordPress to new server: no posts found
- Counting words in a post
- the_post_navigation seems to ignore same category filter
- How to programmatically create posts in wordpress?
- How to avoid duplicate posts on front page?
- Get current users post URL?
- is there a better way of combining this?
- Remove some articles from the list in WPAdmin for a user
- Pagination – Posting First Page Content
- get_permalink executes link without https
- How to show featured image in custom post type dashboard post page
- Notification to Admin or Author upon new post [duplicate]
- Displaying a widget only on long posts (over X characters)
- Remove permalink from images when inserting into post
- How to create a load more post entries like Twitter?
- WordPress blog post cloned and stolen?
- Is there a way to apply WordPress categories at the block level?
- Why is my Blog Page ID == First Post ID?
- Featured Image uploaded, attached and set but only appearing in the media library
- Insert woocommerce products programmatically with featured image and gallery
- CF7 upload file failing [closed]
- wp-cli post create & media import issues
- Getting the current author (it has changed) of a post, not the original author
- Hightlight unread posts or new posts since last login
- Editing 375 posts simultaneously? Maybe from the database?
- Why does WP_Post not contain its permalink?
- How Do I Get My Post Tags to Alphabetize?
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- Remove Featured Image & All Media Uploaded to the Post
- How show categories in admin and get that selected to show posts in index
- How to add a class to edit_post_link?
- Transition from Draft to Scheduled Post with wp_update_post
- Display related post by tag name of current post
- Get posts with multiple categories
- Do not show children of a category
- Posts showing […] in it
- Custom Permalink Structure for Pages & Posts
- Getting a “404 Not Found” error when “Preview Changes” is clicked
- Display a list of users who have viewed the post you are viewing
- How to give classname to post if post has no content?
- wp_update_post creating revisions instead of updating the post
- Where exactly should I hook in order to change the post’s ID before insertion in the database?
- Display selected categories onto post page
- WordPress pagination and Post Navigation not working on home page
- Audio post format with Advanced Custom Fields
- Would a “hub” page work better as a page or a post?
- Some doubts about how the loop work (trying debugging it)
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Same post appears in related Posts?
- How can I create an RSS feed that includes “Private” posts?
- Change post date in menu to post title
- How to view all posts (on site, not admin) that are uncategorized?
- How to create a list of links to post with specific category
- Automate post update for all posts?
- Allowing Users to Register Themselves and Post : Does WordPerss Handle these Problems?
- get parent fields title, content excerpt etc
- Rest API Paginate until all posts are imported
- DEL media from the post but keep my featured image or post
- Group first, 2nd, 3rd, etc posts by category terms
- Set post title font size automatically according to number of words in post title
- exclude particular category in api
- wp_trash_post() duplicates post to trash
- How to backup WP blog posts to computer, not new site
- Make categories appear random
- Add view to admin menu to filter for specific criteria ( If post is child of specific Parent )
- Create Posts from API response without duplicates
- I want to change the WordPress comments file
- How to find the edit link of the WordPress Post from the URL
- Get posts from category from custom query
- Changing a users posts to drafts upon role change
- How can i take all ids from untrash_post action?
- Can I Paginate Post after every 25 tag?
- How to show posts ordered by random [duplicate]
- Query posts from newest category
- Trim excerpt to first paragraph
- Adding div to WordPress page content
- WordPress loop uses unmodified posts array, why?
- Create new post on user registration
- Ajax – Post Categories and Load More
- Skip posts, but keep posts per page
- How to display custom content in post with category XXX
- how to add a facebook page latest posts into my wordpress site
- Displaying categories items among posts
- Display only posts with comments
- Display ONLY Latest Post From Several Categories
- how to show all type of author posts in author page (SOLVED)
- WordPress Page Column Problem [closed]
- If meta_key exists then don’t select this post?
- Is there a block to print post link standalone in a block theme?
- Adding contents to my wordpress site
- Can`t Access Post Page After Migration
- Moving featured image to top of new post editor screen
- Display posts with id equal to relationship value