A modern web application that uses Next.js as the frontend and WordPress as a headless CMS backend.
- Fetches posts, pages, and custom data from WordPress REST API
- Static site generation (SSG) and server-side rendering (SSR) with Next.js
- SEO-friendly and performant
- Easy content management via WordPress admin
- Customizable and extensible
- Node.js (v18+ recommended)
- npm or yarn
- Access to a WordPress site with REST API enabled
-
Clone the repository:
git clone https://github.com/yourusername/next_wordpress.git cd next_wordpress
-
Install dependencies:
npm install # or yarn install
-
Configure environment variables:
Create a
.env.local
file in the root:WORDPRESS_API_URL=https://your-wordpress-site.com/wp-json
-
Run the development server:
npm run dev # or yarn dev
Open http://localhost:3000 in your browser.
next_wordpress/
├── components/ # React components
├── pages/ # Next.js pages
├── lib/ # API utilities
├── public/ # Static assets
├── styles/ # CSS/SCSS files
├── .env.local # Environment variables
└── ...
Deploy easily to Vercel, Netlify, or any Node.js hosting provider.
MIT
Customize this README with more details as your project evolves!