I decided to rewrite my code and no longer use JS to open the Modal window, but pure CSS. I then attached the POST ID to the ID tag so that each modal window would be unique.
code for a tag below. Href matches the ID on modal div.
<a href="#open-modal-<?php echo $post->ID; ?>" class="button gallery-button">View Images</a>
Related Posts:
- Filter by custom field in custom post type on admin page
- Getting custom taxonomy from custom post type
- Media library – Limit images to custom post type
- Filter next_post_link() and previous_post_link() by meta_key?
- importing third party json feed as custom post type [closed]
- how to get posts by custom post type then display Custom fields?
- Filtering a WP_Query meta_query by numeric values isn’t working
- Populate a ACF Select Dropdown from Custom Post Type
- Automatically fill custom field value on post publish/update
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Make permalinks based on an ACF-field
- ACF Relationships in Custom Post Type Permalink
- WP Rest API Querying Custom Posts by ACF fields
- How to sort a table of custom posts by column containing custom field
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- List events by month
- Use Custom Post Type as Custom Field
- Count custom post types with a specific meta value
- Query by 2 values of a repeater ACF field
- Insert slider (Custom Post Type) into pages
- get terms that have post with custom post type between 2 values
- How to set custom post type as post title to avoid ‘Auto Draft’
- Pull image from ACF field in a Custom Post Type
- Archive filter disappears on no results?
- Query current and future events, ordered by begin date
- Show ACF field from custom taxonomy and display on the single template
- Change message given when deleting post from custom post type
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Display posts if a custom field value is equal to another custom field value
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Linking three taxonomies with ACF
- Get Custom Field Values by Another Custom Field in WordPress
- WordPress custom post type archive with description
- wp_update_post based function works on existing posts, but not new posts
- How to Display ACF Relationship Custom Field as Link to Specific Custom Post?
- Show custom field from custom taxanomy term on custom post type
- Query Custom Post Types by date (custom field) range
- How to replace custom post type slug with an ACF value?
- How to create an array for a CPT post ID to use in an IF/WHILE statement
- Link users to a custom post type
- Remove duplicated values from a loop
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- “add_post_type_support” with Custom Post Type & ACF
- Custom Post type with ACF in REST API, how do I get those values?
- ACF simple text field value not showing
- Post Object Filter by Custom Field, not title (ACF)
- Custom Post Types not showing, custom WP_Query
- Rewrite WordPress URL to show CPT meta field data
- Create 3 Level Relations with ACF and WordPress
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Multiple ACF Repeaters within a Custom Post Type
- How to change post featured image using a custom field of category?
- Validate custom fields before save using WordPress Rest API
- get_posts of Custom Post Type AND Custom Taxonomy
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Custom fields vs. Custom post types for a Portfolio Website
- WooCommerce – Complete Order when an action occurs
- ACF – Query relationship without ID
- ACF Relationship: Group posts by parent category term, then child [closed]
- ACF Field to set Publish Date – Post Duplication upon Update
- Getting ACF relationship field information
- WordPress Loop trouble with ACF [closed]
- using a template for more then 1 page
- Retrieve a post with its ACF repeater fields in wordpress
- How to I add count of custom posts listed in a post as a prefix to its title
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Why custom search engine only searches in post titles of custom posts?
- Filter page ID outside the loop and order
- Elementor Custom Query to get Posts by ACF (Post Object Field
- Display ACF object field data using Elementor Custom Query
- Custom taxonomy meta fields
- Create WP multisites as a custom post type
- WordPress WP_Query Sort by 2 dates – custom fields
- Post object GUID adding http:/
- Two custom post type relations
- Custom Sort Order for Custom Post Type Taxonomy
- Display custom post type attached media file sizes
- selecting custom post types and taxonomies for hub page listing blocks
- WordPress post objects in one parent post object
- Meta query with ACF relationship field
- Made a Custom Post Type using ACF. Via the dashboard I cannot see the view button to see the post
- Creating a Single Instance Custom Post Type with Limited Module Options using ACF and WPGraphQL
- Code output help please! WordPress> ACF > Relationship > Post Object
- ACF Pro simple Business Directory – Requesting assistance with created Templates and associated Functions.php Coding
- How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
- WordPress custom post type -> query and sort by custom field with multiple values, then published date
- WordPress duplicating posts from single loop
- Use Custom Field to Display Post Loop
- Custom fields disappearing when a custom post type is assigned
- How to automatically update ACF field value every year?
- displaying ACF Repeater Fields in Backend sorted by a subfield
- Advanced Custom Fields Custom Post Types Heirarchy
- Generate Post Title From ACF Fields on Custom Post Type
- How do I add a filter to my custom post type archive page?
- How to Dynamically Filter Custom Post Types by Taxonomy Based on URL in Elementor Pro and ACF?
- ACF – Updating all posts of CPT when a custom field from options page is updated