Change theme

Hi @zackrose21

TBH I haven’t used ACF. Looks like you’ve managed to add it to the WP REST API - I think you need a separate plugin to do that. You’ll probably need to do a fetch from within the component that’s rendering your single post page. See here for more info.


So say I have my assets pulled through and render them on the page eg a text and image. Then say I want to be able use that layout anywhere across the site. Would I make a new folder with whatever I want to call that reusable layout with an index and styles.js and then import it anywhere?

Thank you

I think it needs to be something like:

&:after {
    background: rgba(0, 0, 0, 0.7);

Frontity uses the Emotion library for CSS-in-JS, you can find the Emotion docs here.
Hope this helps.

You don’t necessarily need a new folder, but creating a new component in a separate file is a good idea. The styles could be in a separate file or could be included in the same file as the component. See mars-theme for examples of how the component and styles are in the same file.

Thank you

Is it possible to install and try to use the frontity theme as a test ?

Thank you


Yes, go ahead and clone the repo - it’s OSS.

A better way would be to check the isHome boolean property.

The content from the gutenberg blocks should be in the content.rendered property for the post/page. The styling may not be the same though. Take a look at the frontity theme for examples of working with gutenberg blocks, as you suggested.

Also take a look at this post.

A better way would be to check the isHome boolean property.

ah yeah good point :slight_smile:

1 Like