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 next_post_link() and previous_post_link() by meta_key?
- how to get posts by custom post type then display Custom fields?
- Automatically fill custom field value on post publish/update
- Make permalinks based on an ACF-field
- How to sort a table of custom posts by column containing custom field
- Insert slider (Custom Post Type) into pages
- get terms that have post with custom post type between 2 values
- Pull image from ACF field in a Custom Post Type
- Archive filter disappears on no results?
- Linking three taxonomies with ACF
- 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?
- How to replace custom post type slug with an ACF value?
- Link users to a custom post type
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Validate custom fields before save using WordPress Rest API
- get_posts of Custom Post Type AND Custom Taxonomy
- How can I dynamically add a post to a custom post type which uses a custom field?
- the_content() not outputting anything (Advanced Custom Fields)
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- Troubles with acf/save_post and WP_Query
- Query custom post type with ACF Date
- custom post type WYSIWG removes paragraphs when displayed
- ACF From & To Date Validations
- Exclude objects from WordPress API based from ACF field using rest_prepare_{$post_type}
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Order Custom Post Type by Custom Field Value
- Retrieve custom field from Contact Form 7 [closed]
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- How to update post meta on uploaded image from a custom form?
- Multiple Frontend Filters Using Advanced Custom Fields
- Specific routing for CPT
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- Advanced custom field boolean value in custom post type
- Why would social icon badges disappear after adding a custom post type?
- ACF repeater field usage
- List of users that clicked a ‘Join’ button at single post
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- set_query_params using custom params defined in functions file?
- Custome fields not displayed
- How to define the template for custom posts?
- Batch Extract Date from post title and put into ACF custom field
- Query entries from custom post type in an ACF flexible content field
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- How to export custom post type with ACF to individual file with automation?
- Custom post types, disable fields
- ACF Relationship Posts how to show additional content
- Limit search field to just search a custom post type with custom fields
- Custom field with Types: get custom field’s value label (of type select)
- Show posts associated with ACF post object and custom post type
- How can i show ACF in post excerpts
- count & sum the value of custom field of the author post in dynamic posts
- Create if else for post types in WP_Query ‘post__in’ values
- Grouping custom wordpress post types by acf value
- Set Post Private if no linked Post Objects (ACF)
- Show in an entry a Custom Post Type associated to a post
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- CPT email notification including only new value custom fields
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Same custom post type with different ACF
- Load info from customposttype into template page
- ACF meta_key and meta_value break loop
- search results to show individual ACF fields from inside custom posts
- Videos Post Type with Custom Filters
- How to show link to product in custom fields?
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Use output of wp_dropdown_categories($args)
- Looping through image object using ACF and CPT UI [SOLVED]
- Values show up in custom home page but not in custom post pages
- Display related post content and custom field content
- WordPress page not showing up – replaced with last 10 posts?
- Best way to have one product in both rental and sale parent category
- How do I display specific custom posts, and how do I edit a post’s singular page?
- Automatically convert standard posts with custom fields to custom post types
- Showing custom post user wise with different color in wordpress
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- Filter Content on all Post Types
- Get month and day from a Date Picker custom field
- Advanced Custom Fields – Add Field to Specific Page [closed]
- $post breaking container loop
- Collection of fields in a single post
- using a template for more then 1 page
- Retrieve a post with its ACF repeater fields in wordpress
- Filter page ID outside the loop and order
- Elementor Custom Query to get Posts by ACF (Post Object Field
- Custom taxonomy meta fields
- Create WP multisites as a custom post type
- WordPress WP_Query Sort by 2 dates – custom fields
- Two custom post type relations
- Custom Sort Order for Custom Post Type Taxonomy
- 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
- 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 duplicating posts from single loop
- Generate list of posts on a page, but fill shortcode values from ACF fields on that page