next-wordpress-docker

Stars
5

Local Headless WordPress Development With NextJS

This application was generated with the WordPress example

yarn create next-app --example cms-wordpress cms-wordpress-app

Example code for this post

Development

Beacuse the Headless Mode plugin is being used, all unauthenticated requests to the front-end of the WordPress site will be redirected to the client. The redirect URL is already configured for local dev. You will need to set one constant in production to match your deployed URL for the client, as documented here.

PHP Code

The directory "wordpress-plugin" is a plugin that will be activated. You can put PHP code there. This is a good place to register custom post types, mutations, etc.