Have you tried passing $pid instead of using get_the_ID()
?
if (get_post_gallery($pid)) :
$gallery = get_post_gallery($pid, false);
endif;
Related Posts:
- Return only one post format in index.php [duplicate]
- Get gallery and product gallery images full size
- Change the way wordpress outputs images or image galleries
- Jquery Slider for profile template
- Split Content and Gallery
- AJAX with loop filtering categories
- How to get the first image gallery of a product in woocommerce in a loop
- Can I load posts via Ajax?
- pop-up lighbox with AJAX
- Ajax loop in sidebar to load post titles/categories
- Filtering posts by multiple taxonomies
- Ajax loop refresh on click
- Add Infinite Scroll to Ajax Loaded Category Query
- Load comments per post on click with AJAX
- Chopping up a large ajax request of around 200 posts [closed]
- How to get_template_part using AJAX?
- Category Ajax call
- Customize WooCommerce Product Images (Placement and size) [closed]
- Split loop to load WordPress gallery into Bootstrap modal and carousel
- How do I use AJAX Query in my posts loop?
- Ajax Button to load more Posts into a timeline
- show random image in loop if image is not set
- Shortcode in posts called by ajax is not working
- Distribute Gallery Images Every nth in Loop
- Scrolling Posts with Ajax
- Get post offset/posts page offset in single post page (outside the loop)
- display post format text in loop
- Closing the loop…featured image variable based on post id
- using wp_get_attachment_image_src in foreach loop
- How to print redux gallery feilds id? [closed]
- Multiple instances of Featured Image Thumbnail As A Background On Homepage
- Fetching posts from wordpress function in ajax
- How to render the single post template with the post name?
- Using jQuery .after inside loop
- Getting selection of posts based on loop variables via Ajax
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- Loop order issue with Ajax filter
- $post is undefined in wordpress loop [ajax]
- Database query and get_user_meta return incorrect data
- Submit form for loop of products of the term with AJAX
- Get a specific size from wp_get_attachment_image_src
- How to avoid appending “null” in Ajax?
- Split Content and Gallery
- How to manually define the primary loop
- Attachment Metadata inside of Loop
- Cant pull in featured Image
- Ajax category pagination problem
- setup_postdata in “loop-handling” php file called via $.ajax
- Building theme so user can change header image [closed]
- Is there a way to target only images within the loop?
- Load featured article once in a loop
- Loop doesn’t give the thumbnail the right parent (or class)
- AJAX in wordpress theme loop
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- show title and displaying link gallery
- How to fix pagination for custom loops?
- Counting the posts of a custom WordPress loop (WP_Query)?
- if ( is_home() && ! is_front_page() )
- Get excerpt using get_the_excerpt outside a loop
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- Get post content from outside the loop
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- Display featured products through custom loop in woocommerce on template page
- How do I delete all UNUSED images from my uploads directory?
- How to get Author ID outside the loop
- How to extend the gallery block in Gutenberg?
- How can i display the content in plaintext
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- Do I need to use The Loop on pages?
- How can I fetch loop of post titles via AJAX?
- Remove the Homepage Query
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- How to force excerpts / teasers in the loop
- get_post_gallery with Gutenberg
- Retrieve each widget separately from a sidebar
- How to have different captions for same image, for galleries?
- Why am I being limited to ten posts on a custom loop?
- get_post_gallery_images returns thumbs . I want full size
- Should I use loop in the single.php file?
- A search for ‘0’ returns results
- Why do themes rely on “The Loop”?
- How to return loop contents
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- WP 3.5 and Galleries – how to count images?
- Navigate with keyboard in Gallery shortcode
- Add existing images from Media Library in to custom gallery
- How to draw media details for Isotope gallery using Photoswipe
- Cropped featured image replaces original image in gallery
- Insert image or ad script after 3 posts using the loop
- Get date of last update outside of loop
- Pagination not working on home page
- Child Pages Loop