You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- When it finishes it'll tell you to change into your new theme's folder and run the Nodejs watcher (replace "my_react_theme" with the same name you used in the previous step):
23
25
-`cd my_react_theme/react-src`
24
26
-`npm run wpstart`
25
-
- or if you have yarn installed:
26
-
-`yarn wpstart`
27
27
- That sets up the theme so that it can be seen in the WordPress admin area.
28
28
-**Go there now and set your WordPress site to use this theme.**
29
29
- View the site in your browser with the new theme.
@@ -33,7 +33,7 @@ To create a WordPress theme using the `create-react-wptheme`, follow these steps
33
33
-**You can revoke write access after the setup has completed.**
34
34
- Interested (paranoid?) about what it's doing? Check out the file: `<your theme folder name>/index.php`
35
35
- When that's done the theme tells you to `Please restart the Nodejs watcher now...`
36
-
- To do that, go back to your command prompt where you first ran `npm run wpstart`or `yarn wpstart`and rerun that same command again.
36
+
- To do that, go back to your command prompt where you first ran `npm run wpstart` and rerun that same command again.
37
37
- In a few seconds you should see your browser load with the standard create-react-app page, but it's running as a WordPress theme!
38
38
39
39
## Coding with React
@@ -72,7 +72,7 @@ that you can mess with if you need to.
72
72
73
73
### Build Configuration
74
74
75
-
The `react-src/user.prod.json` configuration file is read when you run `npm run wpbuild` (or `yarn wpbuild`). The only option in there is setting the "homepage"
75
+
The `react-src/user.prod.json` configuration file is read when you run `npm run wpbuild`. The only option in there is setting the "homepage"
76
76
which controls the relative linking to files in your theme. The "homepage" setting in your main `package.json` file is used during development (and build by default).
77
77
During development, this is probably what you want. But if you know your production server will have a different root, then you can set the homepage to be different during
78
78
a production build.
@@ -85,7 +85,7 @@ For example:
85
85
- But you know that your production server runs WordPress from the root: http<nolink>://mycoolblog.com/
86
86
- In this case you want to remove the `/wordpress` part, so set the "homepage" line in your `user.prod.json` file to:
- Note that if you then view your theme on your dev server, it will most likely be broken. But will hopefully look
90
90
correct on your production server.
91
91
@@ -124,7 +124,6 @@ To configure the Browser Refresh Server to use SSL, follow these steps:
124
124
- All OSes: `cd ..`
125
125
- Start Node/Webpack JS watcher as you normally would:
126
126
- All OSes: `npm run start`
127
-
- Or if you use Yarn: `yarn start`
128
127
- Your theme should open in a new browser tab
129
128
- If you need to add an SSL exception to your browser for your new certificate, there is a page running over HTTPS at the "host" and "port" you set in `user.dev.json` above.
130
129
- For example, if you're using host `127.0.0.1` and port `8090` as shown above, then open your browser to:
@@ -147,14 +146,10 @@ To configure the Browser Refresh Server to use SSL, follow these steps:
147
146
- Touch the original `react-scripts` as little as possible.
148
147
- Add new files where possible.
149
148
- This will make merges easier.
150
-
- Don't laugh at things like the "return" jammed right in the middle of `init.js`.
0 commit comments