Attachments are post objects, with post_parent
set to the ID of the post they belong to (ie your ‘session’). The WP Codex page on wp_get_attachment_image()
has an example almost exactly like what you’re trying to do: https://codex.wordpress.org/Function_Reference/wp_get_attachment_image#Display_all_images_as_a_list Make sure that you replace the post_parent
parameter in that example with the ID of the current session (which will probably be get_the_ID()
, though it depends on how your loop works).
Related Posts:
- Creating a gallery of featured images from custom post type
- How to make a page template to list all galleries?
- Creating a gallery custom post type?
- How do I organize photos for multiple galleries?
- How to insert multiple images into a single post within a CPT
- Custom Post Type with image gallery
- Not Able to Get Custom Post Type Gallery Images URL
- How to create a gallery page with categories?
- Can anyone help me with galleries and post types?
- How to add multiple images to a custom post type without plugin [closed]
- How can i link a custom post type thumbnail to intermediate size
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Editor / Add Media: Is it possible to only allow galleries?
- Separate Content from gallery (custom post type)
- How to Organize and Sort Gallery of Images
- Galleries of images attached to posts
- Feature image Gallery made from Custom Post type + Categories
- Edit is changing my custom’s post type parent id
- Loading a template for a URL pattern
- Making a archive gallery page for a custom post type which already has an archive page
- How to add gallery support to a custom post type?
- How can I detect a chosen Isotope layout option from within Javascript to generate appropriate layout?
- How can i embbed two different galleries in custom post type
- How do display gallery embedded to the custom post type
- Is it possible to create a separate page for custom posts gallery?
- create gallery page for specific post id
- Gallery not displaying images when clicking on them
- Get images only from a certain post type
- Slideshow/Gallery plugin based on WP Core Gallery [closed]
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Custom Post Type Settings page, choose page to display archive
- Change Custom Post Type slug
- wp_pagenavi() with custom wp_query()?
- Loading Custom Post Type Events into jQuery-based FullCalendar?
- Custom admin columns for ALL custom post types
- Use Custom Database with Custom Post Type
- How to remove CPT comment feed from head?
- Custom Search form not working in localhost
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- Show admin help message across custom post type parent and child posts
- Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post
- Permalinks when filtering multiple custom post types by single taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How to have the right design for a custom post type without accessing themes
- WordPress As A Shared Items Collection
- Displaying Posts of a Custom Type
- Is there a way to get a file URL from the relationship ACF field?
- Replace li Items with divs with classes
- Get custom fields from a custom post type with a shortcode
- showing custom post types of a certain category only
- Is there a way to enable bulk edit and quick edit on custom post types?
- Conditional Query of Custom Post Type and custom taxonomy
- Specific query for custom post type
- remove base slug from hierarchical custom post type
- How to retrieve category of a post in have_post loop?
- Relationship between set rewrite flag in register_post_type and add_rewrite_rule
- Custom Post Type Category On Admin
- Custom User role not working with custom post type
- Is it safe to change a Custom Post Type from “hierarchical:false” to “hierarchical:true”?
- Move content between custom post types
- Pods CMS: How to add custom column to Adnvanced Content Type
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- page not found for single-type.php file
- How check if a post is saved from backend or frontend?
- Exclude Custom post type from /blog page
- Creating a “glossary” of WordPress posts of a specific post type
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- How to filter url on post submission?
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Custom Plugin – Query CPT – Display Results
- Custom Post Type URL Rewrite’s
- Control over custom post types on a specific page
- Get dropdown child categories from parent category of custom post type
- How to display the post using a shortcode in WordPress?
- How do you create pillar content pages?
- dynamic vue widget inside custom post
- Changing default admin column sorting to an ACF Date Picker field
- Get meta values from parent post and save in child post
- Cache the registration of a custom post type?
- Custom post type suddenly vanished from admin
- Set different posts_per_page for custom post type/taxonomy
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- how to use two permalinks for one custom post type based on categories
- issue with custom post type feed
- Creating adminable dynamic filtering on custom post type
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- WP_Query for CPT with filter by another WP_Query
- Use the page picker from wordpress menu creation page
- Custom post type archive pagination with HTML5Blank theme?
- Ordering custom post type by custom field without a title
- Function that get ACF fields value before saving
- Reading csv from specific directory and insert it to custom post type (cron job)
- Problems with a custom meta_box
- Show custom posts with a specific “custom TAXONOMY slug” on startpage
- Plugin – read post into blank page [duplicate]
- How to make a single Menu Item call another Mega Menu for Custom Post Types and Custom Taxonomies?
- WordPress show custom post type on homepage
- Storing every individual update to the posts being updated over time?
- Change CPT Edit Target Link for Admin List
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?