Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1.32 KB

File metadata and controls

26 lines (16 loc) · 1.32 KB

Demo: Fetching a menu from WordPress

Open in CodeSandbox

This project is a demo to show how we can fetch a menu from the WordPress REST API and use it in a Frontity project. This allows content creators/editors to make changes to the menu structure in the WordPress admin and for those changes to dynamically show up in Frontity.

You will need to install and activate the "WP-REST-API V2 Menus" plugin. Menus are not natively included in the WordPress REST API. This plugin creates endpoints which allows us to fetch menus.

A tutorial demonstrating the code in this repo can be seen in the following episode of Frontity Talks: Fetching menus from WordPress

More info can be found on this blog post.

Install

npm install

Run the app

npx frontity dev

Runs the app in development mode. Open http://localhost:3000 to view it in the browser.