Sets the homepage in frontity

Hello All,
So testing the frontity about how it works. I have it installed the wordpress and the frontity with mars theme. Now, i created a new homepage but its not showing when going to localhost:3000
My frontity settings should be right?

but then showing the post instead

Is something i did in here missing?

Please advice…
Thank you

Hi @gallonjuanito

Welcome to the Community!

Can you please provide a repo or code-sandbox with your code? This is especially helpful to find solutions of technical issues with specific code

If you’ve selected an alternative homepage from WordPress you may have to change these settings in fronttiy:


If you’re new to Frontity I recommend you to follow the https://tutorial.frontity.org/ that it will guide you through the process of creating a Frontity project while reviewing some of the basic topics of the framework

Thanks…
You mean here from the frontity.settings.js, I added the main url as the homepage, im using the flywheel by local.

const settings = {
  "name": "frontity-project",
  "state": {
"frontity": {
  "url": "http://devs.local/",
  "title": "Test Frontity Blog",
  "description": "WordPress installation for Frontity development"
}
  },
  "packages": [
{
  "name": "@frontity/mars-theme",
  "state": {
    "theme": {
      "menu": [
        [
          "Home",
          "/"
        ],
        [
          "Nature",
          "/category/nature/"
        ],
        [
          "Travel",
          "/category/travel/"
        ],
        [
          "Japan",
          "/tag/japan/"
        ],
        [
          "About Us",
          "/about-us/"
        ]
      ],
      "featured": {
        "showOnList": false,
        "showOnPost": false
      }
    }
  }
},
{
  "name": "@frontity/wp-source",
  "state": {
    "source": {
      "url": "http://devs.local/"
    }
  }
},
"@frontity/tiny-router",
"@frontity/html2react"
  ]
};

export default settings;

I did check out the getting started guide on how to install and get the stuff running, just want to know how i can set my new page to be the new homepage.

Thank you

Hi @gallonjuanito,

I use the following setting in my frontity.settings.js to set /blog as my frontpage:

{
      "name": "@frontity/wp-source",
      "state": {
        "source": {
          "api": "https://wp.mydomain/wp-json",
          "homepage": "/home",
          "postsPage": "/blog",
        }
      }
    },

I hope this helps

Thanks, now it works…
When i looked at the docs, it didnt say about the api Quick start guide - Frontity so i didnt bother adding it…lol,
thank you!

2 Likes

I don’t think there’s any difference (in your case) using api or source. the important thing is to define your homepage like you’d in WP :slight_smile: