admin管理员组文章数量:1405918
I will try to explain what I am trying to accomplish. I have created a post type "cars" and a file archive-cars.php
When I visit this page slug it displays all the posts. I have created a Javascript modal which I would like to display for each CP post type.
But, as you guys know you don't want to output the same HTML markup for each post over and over again. Which will result in a very large page?
I have one HTML markup for the modal and I want to use this same markup for each post when you toggle the modal.
I have tried with wp-json to fetch the data using Javascript. The dilemma is that I don't know how to dynamically load the post data on click with Javascript so that the markup stays clean in the long term.
Can someone tell me how I can do this with wp-json REST API and an archive page? do you guys have any example?
本文标签: rest apiCustom post type archive pagePosts overviewwith one modal for multiple posts
版权声明:本文标题:rest api - Custom post type archive page - Posts overview - with one modal for multiple posts? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744935697a2633168.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论