Hi, I am new to Frontity and am unsure how to access the data from my Wordpress site.
I have followed the Getting Started instructions, replacing the default URL with my Wordpress websiteās URL in frontity settings.
On the Wordpress site, I have a list of courses displayed in grid fashion which users can add to their cart. However, when I access the same route using Frontity (i.e. /courses route) I am unable to retrieve the coursesā data (i.e. titles, prices, images) from the response (checking under the Developer tools console)
Am I missing something here? Any advice would be appreciated. Thanks!
Hello! I recommend following this tutorial as it helps you to access the state and set up your pages, posts etc and all the frontity tools you need to make that happen https://tutorial.frontity.org/
Thanks! I did just complete the tutorial though, but it doesnāt seem to translate when I try to apply it to my own project. I am able to access posts yes, but other data such as products I am somehow unable to access.
How do I differentiate a CPT from other types? I am new to WordPress as well and am not sure whether I am filling in the type, endpoint and archive correctly.
When I try to access /courses like the example shown (but with my website), I get āmessageā: āNo route was found matching the URL and request method.ā
Detailing the info suggested here when having issues will help the community to provide the best possible help as quickly and as efficiently as possible.
Also in your case, the endpoint of your REST API where your CPT are available will be helpful to help you with your issue
In addition to the resources mentioned above we also have:
this repo which demonstrates the usage of CPTs in a Frontity project.
this video in our Frontity Talks series which also covers this subject.
If the endpoint doesnāt exist itās possible that the plugin author has not added the CPT to the REST API. You can do this yourself by adding a code snippet. See here for more info.
Here you can check what are the default post types of WordPress. If itās not in that list, then itās probably a custom post type or a custom taxonomy.