This is a demo project to show how to use Next.js with WordPress as a headless CMS.
It uses GraphQL to fetch data from WordPress and render it using Next.js.
git clone https://github.com/ilasw/wordpress-headless-next.git
cd wordpress-headless-next
docker-compose up
Open http://localhost:8000 with your browser to see the result, and http://localhost:8000/wp-admin to access the WordPress setup.
Note: in the .wordpress
folder you will find a volume that contains all the wp-content/plugins/
folder, which contains the WP plugins.
wp-graphql
and wpgraphql-blocks
are mandatory plugins.
cd next
npm install
npm run dev
Open http://localhost:3000 with your browser to see the result.
- Star the repo and share it with others
- Contact me for any questions or suggestions
- Hire me for your next project: lucapagliaro.it