Since I’m guessing you’re not rendering that Javascript file with PHP, you’ll need to send the ID of the post to that anonymous function using something other than PHP. You could use a data attribute in your #clickme <a> like data-id="<?php the_ID(); ?>" and then change your on click to:
$(document).ready(function(){
$("#clickme").on
("click", function(){ $("#myModal-" + $(this).attr('data-id')).modal();});
});
Or something similar to that.
Related Posts:
- Keyboard shortcut for updating a page or post?
- Ajax Load More Posts in Category Page
- Get the current post ID as a variable in Javascript
- How to create WP Editor using javascript
- Dynamically update post title in admin page
- Add javascript when post is published
- Get post from custom REST endpoint in Gutenberg
- Add confirmation popup on “Move to Trash”
- Create a separate JS application for an individual post?
- Convert a complex webpage into WP theme
- Add scripts on custom post add/edit pages Not Working
- Injecting JavaScript into a Post with WP3.x
- How can I get a post field value using javascript?
- Custom post preview without saving
- Block Editor: Reset Reusable Blocks to last saved record
- Ajaxify This Code
- Integrate OpenStreetMap on WordPress
- Only show a Post once in 10 visits
- In post.php how can I remove onbeforeunload?
- Navigate through the posts using keyboard arrows
- Call current post URL in ajax
- Insert specific information to a posts of a predefined category
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Using the loop to set locations for all posts on a single google map
- Insert JavaScript in a blog post or a new page?
- Why is it recommended to insert JS through the theme, plugin, etc rather than in the post directly?
- WordPress React re-rendering to many times
- Ajax post doesnt call succes after got the response
- Blog Post slider not working
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- testing result of $.post with json_encode
- Loading posts outside wordpress
- Front end post delete error confirmation and success message
- How to hide a script ( an ad) from a specific post? [closed]
- WP Rest API feature image breaking react component
- How can I add a custom caclulation form in post?
- How do I save JS classes being applied to the WP dashboard via custom plugin?
- WordPress custom post_status after 6.6 version
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Is it possible to bold certain words in a post title?
- Displaying the category name of a custom post type
- Most efficient way to insert a post outside WordPress?
- Display content from a specific category
- Delete posts from a post type automatically via Cron
- Template file for static posts page does not get loaded?
- Post X of Y in single.php / sidebar.php
- How can I get a list of latest posts outside of my WP install?
- WordPress Posts Out Of Order after 3.1 Update
- Paragraphs removed when using get_post_custom()?
- How to customize read more link
- Handling an Ajax form submit
- Post taxonomy from exif data
- Underscores.me retrieve next / previous post thumbnail in post_nav function
- Adding a text link under the post title in the lists of posts
- Count to how many categories a post belongs to
- Create cron job without a plugin?
- Post Filter by Date and time
- Using wp_list_categories like the the_category (showing just current categories of a post)
- add new post default view
- How to filter my search in post if contains a word in title, content or excerpt?
- Genesis + Ajax + Jquery | Failling to call action
- Need help with category listing!
- Query posts and return XML
- A friend wants to make a comment on one of my articles, she has to be logged to wordpress?
- How to display only feautured/sticky listings on the homepage
- Conditional Tag for has post [closed]
- Update Post Meta is adding a value to my serialize array
- How to change the layout of posts when viewing all posts by tag [closed]
- Intercept page request and add value to it
- HTML Form Submit to table in same page
- Single post full screen template not inheriting WordPress role permission
- Only show featured image on exerpt and exclude images in post
- Get timestamp of latest post in C#
- Prevent 404 of Author pages without posts
- Categories Listing and Highlighting current category item
- In admin panel, use a form to create a post?
- WP_Query get posts in custom database table [duplicate]
- How to save template data into wp_post table (post_content column)
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- Sticky Post Doesn’t always work
- My posts are getting to Auto draft when I try to Publish
- Moving Gutenberg content from one website to another (block media ids wrong?)
- Get post by two meta key but order by one of them
- filter buddypress users posts by user ‘xprofile’ custom fields
- Add post id as body class in wordpress admin dashboard [duplicate]
- Is it possible to remove actual post pages in wordpress but keep them in categories
- Blog posts not displaying on blog posts page
- How to add content to the menu
- Multiple Custom Post Type loop logic
- Export Posts with specific custom fields by sql
- Function/filter or plugin to change post status based on custom field value
- How do I paginate posts page with $wpdb?
- WP_Query retrieve custom posts but not the post showing
- How to handle dates, trying to calculate time since a post
- How to Post to Specific Pages?
- Post thumbnail is not shown in wp-admin
- How to have more post in a page than in your home page
- Exclude a ‘portfolio’ custom category?
- Allow User Can See His Post on his dashboard
- How to delete posts with incorrect status