Stupid me! There was an error in my AJAX call so I was passing the wrong post ID in the second case. So, nevermind guys.
(Is there a to delete a question? Can’t seem to find one).
Related Posts:
- How to remove title attribute from gallery links and images
- Exclude images from “inserted into post” when trying to get attachments
- Customizing the attachement page to show rest of all images in a gallery from post
- Help to upload post attachments from Ajax
- One picture belonging different galleries?
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- attachment.php & flexslider—linking thumbnail to specific image
- wp_get_attachment_link() add rel attribute if the link points to direct image
- Programmatically get images by URL and save in uploads folder
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- get_post_gallery with Gutenberg
- wp_get_attachment_image_src and server path
- get_post_gallery_images returns thumbs . I want full size
- get images from post and make a zip
- Insert an image into a post by API
- Function to call the attachment image from post
- Bulk edit wordpress images alt and title attributes
- How can I hide media library images from general users?
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- How do i upload an image and return the image id?
- Get Attachment ID from URL [duplicate]
- Setting up a gallery with images and a zip download
- Separate attachment images from post loop
- How to display a shortcode caption somewhere other than the_content
- Displaying a featured image (only img url) as the img src?
- Allowing post attachments without allowing to insert in text
- Rename attachments during upload
- How to link Gutenberg Gallery images To Media file automatically?
- get attributes/part of the gallery shortcode
- Image still linked as attachment to page even though it has been deleted
- Display one random image, but only if landscape
- get_attachment_id() only get id of first attached image after post update
- Is there a way to get attachment data?
- How to change image url?
- Best option for photo/gallery handling?
- Add a new data attribute in tag
- Custom page template to display all image attachments
- get the image of the post
- Get meta data from image
- Override img class in gallery
- Add an attribute to attachments
- Pull Random Attachments With Pagination
- Out of memory error reporting
- How can I attach hotlinked images in posts/pages within the same server?
- WordPress Image Attachment using remote image
- attachment.php code or tutorial
- Is this post using WordPress Gallery?
- Turn off image captions in gallery view?
- Unyson Framework doesn’t show gallery images
- Auto delete attachments that are older than x days
- Images attached to posts from library link to 404 error page
- How to implement secure frontend image upload? [closed]
- Replacing the content of an image attachment using API
- Removing featured image from gallery?
- Gallery with thumbnail carousel
- Does wp_get_attachment_image_src also work with non-image files?
- Media gallery images url instead of ID on WP API Response
- Get all image IDs from the Media Library
- Get images attached to a specific page
- WordPress Creates Unused (Unregistered) Image Sizes
- Allow users to contribute images to a post
- What is the best way to associate multiple images to one page?
- How to get the cropped image from media library?
- Use full size images in a specific gallery
- How to automatically populate a gallery with images attached to posts of one category?
- Random Characters in the end of every image url in post
- How do I display the featured image from an image gallery using a reference in code? (example within)
- How to replace post image url before posting using api?
- How to get post id of first child of the same post type?
- Attachments without images
- attach several images to post + gallery
- how automatically show the image title before the image caption/description in a wordpress gallery?
- change the h3 subtitles of the wordpress gallery shortcode
- wp_insert_attachment() dupplicate attachment posts
- How to echo images Urls from a wordpress post, that are relally in the post
- SQL: How to find all attachments that are not used in any posts/pages/custom_post_types
- Allow users to upload attachments to certain posts
- get_post_gallery with Gutenberg
- How can I add an “Attach image to this post/page” link on the Add Media lightbox?
- Troubles with code for upload a image
- How do i replace the title attribute of img tag with the image caption
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Replacing an Image gallery
- Create a custom attachment thumbnail for quick page load
- How can I hide previous_image_link() on first attachment page?
- Display ajax preloader for large images within posts
- Thickbox not displaying just the image, instead showing full page in lightbox
- Multiple gallery thumnbnails on one page
- Upload unnattached image from frontend
- Image attachement management – a philosophical question
- How do I set the sizes of my thumbnails when inserting a [gallery]?
- *box for images displayed as a post’s [gallery] [duplicate]
- Display X images from a gallery in the sidebar
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Automatically adding blog images to a portfolio/gallery
- How can we see which posts don’t have a featured image or it doesn’t exist anymore?
- How to get WordPress to resize images for srcset?
- Images uploaded in customized gallery do not link to media