Frontity Tutorial
  • 👋Welcome
  • ✔️Checking your progress
  • 1️⃣ Creating a custom theme
    • Create a Frontity Project
    • Create a Theme Package
    • Modify the <Root> component
    • Connect the <Root> component to the state
  • 2️⃣ Adding a menu
    • Use the <Link> component
  • 3️⃣ Displaying posts
    • Understanding the Frontity state
    • Display the list of posts
    • Display the post content
    • Display posts and pages separately
    • Formatting the date
  • 4️⃣ Adding styling
    • Global styles
    • Styled components
    • Styling the links
    • Styling the post info
    • Add dynamic styling
  • 5️⃣ Adding behaviour
    • Use 'state' and 'actions'
    • Add pagination
  • 6️⃣ Custom Post Types
    • Add support for Custom Post Types
  • 7️⃣ Finishing touches
    • Add a <Loading> component
    • Add a 404 page
    • Use the <html2react> component
    • SEO and head tags
    • Other things to do
  • 8️⃣ Deploying the project
    • Deploy to Vercel
  • 9️⃣ Next Steps
    • Learning resources
    • Getting help and support
    • Contributing to Frontity
Powered by GitBook
On this page

6️⃣ Custom Post Types

Although WordPress started out as a blogging platform, it has since developed into a full featured Content Management System (CMS). Part of what makes it so useful as a CMS is it's support for Custom Post Types (CPT). This enables WordPress to host arbitrary data, beyond the default posts and pages.

Frontity is able to work with Custom Post Types, and in this section we'll see how we can use them in our project.

As you will already be aware, our example source data is a travel blog. We have implemented a Custom Post Type in WordPress for our favourite destinations. This CPT is called... "destinations" - what else?! 😄

We've also ensured that the CPT is available in the REST API for consumption by our Frontity project.

This section only contains one lesson. That is because it is remarkably easy to get our project to use CPTs, as we're about to see...

PreviousAdd paginationNextAdd support for Custom Post Types

Last updated 4 years ago