WordPress Gatsby – Custom post types
Why use them?
WordPress comes with posts and pages, but you may want to isolate out content into its own individual post type. The picture below shows how I’ve created two new custom post types called Services and Case Studies.
Using Custom Post types with Gatsby
When building a website in Gatsby you can gather content from CPT that you have created, combining it with ACF advanced custom fields allows you to do some interesting things. Individual ACF for each for post types, uploading images for the index page or videos that are used around other parts of your site.
I use post types for Case studies where in the portfolio page they are searched, and their data is used to sort case studies displayed.
Below is shows the ACF in a page and when i create a new case study to add, I will click the boxes for the correct topic.
Here you can see that all the data from the case studies post type have been used in searching when a user clicks a button for each topic.