Are enabled pretty permalinks necessary to start using Frontity?

Hey everyone,

I might be in this community often over these next few weeks as I’m using Frontity to create a donation based platform for a nonprofit organization. I’ve went ahead and followed through the original Build a React-based Theme for WordPress with Frontity and got inspired enough to begin developing our own React theme for our WP site.

However, I noticed that in the Getting Started docs, one of the installation requirements is to have Pretty Permalinks enabled. I didn’t see this in the video tutorial, nor the How to Create a React Theme in 30 minutes article, nor can I find any online reference on how to enable them in WP as the instructions on the Getting Started docs seem not to match up with WP. Is it necessary to have them enabled for a smooth dev process? Am I missing something?

Please offer any advice if you can, all is appreciated! Thanks everybody.

Hi @akendrap,

Welcome to the Community!

Sorry for not having the documentation updated regarding this.

A few weeks ago, we released some changes that make having Pretty Permalinks enabled an optional thing to have but not really a requirement

So, with latest versions of Frontity packages your Frontity project should work with both Pretty Permalinks enabled or disabled

Hope this help

Thank you so much! That makes sense.

1 Like

Hey @Juanma, that is not entirely true. We don’t have handlers for plain permalinks in wp-source, only for pretty permalinks.

What we added in that release was a handler for posts and pages using plain permalinks (?p=123 and ?page_id=123) but only because the post preview of posts that are not published yet use those URLs in WordPress, like this: ?p=123&preview=true.

But we don’t have handlers for plain permalinks of other entities, like archives, taxonomies, attachments and so on.

Sorry for the confusion.

Hi again @akendrap,

Sorry for the confusion but I was wrong, you need to have permalinks enabled as indicated in the docs to work with Frontity.

The reason behind this is that Frontity expects the WordPress REST API to be available from https://your-wordpress.com/wp-json and this URL pattern is only set under some pretty permalinks configuration

If the default plain permalinks is kept (something not really very common in most WordPress installations) then the REST API is available under https://your-wordpress.com/?rest_route=/wp/v2 as explained here

I was confused by the recently released enhancement I mentioned but now I understand better that change after @luisherranz clarification

Hope it’s clear now.