Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 45f869a

Browse files
committed
mention previews and other fixes
1 parent 9cf9b67 commit 45f869a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ https://nextjs-wordpress-starter-staging.vercel.app/
2424
- [🔧 Backend Setup (WordPress)](#-backend-setup-wordpress)
2525
- [Dependencies](#dependencies-1)
2626
- [Install](#install-1)
27+
- [Enable Previews](#enable-previews)
2728
- [💻 Frontend Development](#-frontend-development)
2829
- [Git Workflow](#git-workflow)
2930
- [Deployments](#deployments)
@@ -48,7 +49,7 @@ Querying a REST-API or GraphQL endpoint and looping over blog posts is where man
4849

4950
At WebDevStudios we believe that WordPress is so much more than a blog-- and our clients require support for things like: SEO, forms, previews, search, comments, authentication, custom post types, custom fields, etc...
5051

51-
With this starter, we've figured out the hard stuff"and placed the sum of our knowledge into something the community (and our future projects) could use as a jumping off point.
52+
With this starter, we've figured out the "hard stuff" and placed the sum of our knowledge into something both the community and our future projects could use as a jumping off point.
5253

5354
### How's this all work?
5455

@@ -185,16 +186,21 @@ Before you get started, make sure you have the following dependency installed on
185186

186187
**Step 3: Configure `wp-config.php`**
187188

188-
The follow constant needs to be in `wp-config.php`:
189+
The follow constants needs to be in `wp-config.php`:
189190

190191
```php
191192
define('HEADLESS_FRONTEND_URL', 'http://localhost:3000/');
193+
define('PREVIEW_SECRET_TOKEN', 'ANY_RANDOM_STRING');
192194
```
193195

194196
**Step 4: Start the `nextjs-wp` site**
195197

196198
**Note:** Make sure your local URL matches the `LOCAL_WORDPRESS_API_URL` in the frontend `.env` file!
197199

200+
### Enable Previews
201+
202+
To enable previews, you'll need both a `PREVIEW_SECRET_TOKEN` constant in `wp-config.php` and `WORDPRESS_PREVIEW_SECRET` ENV variable in `.env`. The token can be any random string so long as they match.
203+
198204
---
199205

200206
## 💻 Frontend Development

0 commit comments

Comments
 (0)