How to transfer data from content post WordPress ajax'ω in the modal window with fancybox?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Good afternoon.

Put the layout on Wordpress.
The page loads posts from a specific category. When you click on a post (a post in the tag a), opens a modal window
fancybox. Modal code in the same file page at the top.
In a modal window displays the video and the title of the post.
Video code plan to load using the plugin Advanced Custom Fields(ACF) in the post.

Looking for information and realized that I need to display the data via ajax. Ready examples in my case not, and to collect
other examples are lack of knowledge.

1 - I need when you click on post data (title, videos are of additional fields (ACF) ) was substituted in modal window fancybox.
2 - do I Need to create a separate php file with the code of a modal window?

PLEASE write a working example.

Thank you!
by | 14 views

2 Answers

0 like 0 dislike
Why do you need AJAX? Get your video/title or what else is there in the data attributes or in blocks, and then hide using CSS. And clicking read data from the attributes or show hidden block
0 like 0 dislike

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
35,595 users