I have a question. Hopefully, I will be able to explain what I am trying to do here.
I have created a custom post type "Feeds" and published 10 post types inside that CP.
Now, usually, I would just loop through the CP and display them on a page on page load and display them in the DOM.
PHP will normally output everything when you load the page.
What I am trying to do, I have created a page displaying all the custom post type posts.
But when I click on one post I would like to open a modal which I have created in HTML, CSS, and Javascript which works statically.
I need only ONE modal HTML output to display the specific opened post type title, content and featured image on request/click only using JS.
I don't want to load 10 HTML modal DIv's for each post type instead load them only on request when needed.
Does anyone know, or can give me a simple example of how I can accomplish this using Javascript or Ajax?
Thanks in advance.