Skip to content

Commit ca1a369

Browse files
committed
More README clean up
1 parent 98b8eba commit ca1a369

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For more details check out the rest of this document.
2626

2727
- [Creating a New Theme](#creating-a-new-theme)
2828
- [Updating Existing Themes](#updating-existing-themes)
29-
- [TypeScript Update](#typescript-update)
29+
- [Updating TypeScript Types](#updating-typescript-types)
3030
- [Developing Your Theme](#developing-your-theme)
3131
- [React Tutorials](#react-tutorials)
3232
- [The Public Folder](#the-public-folder)
@@ -61,26 +61,27 @@ To create a WordPress theme using the `create-react-wptheme`, follow these steps
6161
- **If you get PHP errors, most likely your web server doesn't have write access to your theme.**
6262
- Write access for your web server is only needed during this setup step.
6363
- **You can revoke write access after the setup has completed.**
64-
- Interested (paranoid?) about what it's doing? Check out the file: `<your theme folder name>/index.php`
64+
- Interested (paranoid?) about what it's doing? Check out the file: `<Your Theme's Root Folder>/index.php`
6565
- When that's done you'll see: `Now, back in your command prompt, rerun the "start" script again...`
6666
- To do that, go back to your command prompt where you first ran `npm run start` and rerun that same command again.
6767
- 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!
6868

6969
## Updating Existing Themes
7070

71-
When new versions of `Create React WP Theme` are released, you can upgrade an existing theme using a single command.
71+
When new versions of `Create React WP Theme` are released, you can easily upgrade an existing theme using a single command.
7272

73-
From within your theme's `react-src` folder, run this command at a command prompt:
73+
- At a command prompt, navigate to your theme's `react-src` folder.
74+
- e.g. `<Your Theme's Root Folder>/react-src`
75+
- If you use `npm` then run this command:
76+
- `npm install @devloco/react-scripts-wptheme@latest`
77+
- If you use `yarn` then run this command:
78+
- `yarn add @devloco/react-scripts-wptheme@latest`
7479

75-
`npm install @devloco/react-scripts-wptheme@latest`
76-
77-
**Important note for Yarn users: be sure to use `yarn add` instead of `npm install` in the above commands.**
78-
79-
### TypeScript Update
80+
### Updating TypeScript Types
8081

8182
If your theme uses TypeScript, you'll need to modify the theme's `react-app-env.d.ts` file:
8283

83-
- Navigate to the `<Your Theme Root Folder>/react-src/src` folder.
84+
- Navigate to the `<Your Theme's Root Folder>/react-src/src` folder.
8485
- Open the `react-app-env.d.ts` file in your editor of choice.
8586
- Change the line in there to read (be sure to include the leading three slashes):
8687
- `/// <reference types="@devloco/react-scripts-wptheme" />`
@@ -94,11 +95,11 @@ If you're looking at a React tutorial on the web, you can use `create-react-wpth
9495
<br>But you do have to remember that the React app code is one extra folder down inside your theme folder.
9596
<br>Notice that the final folder in this path is `react-src`:
9697

97-
`/xampp/htdocs/wordpress/wp-content/themes/<Your-Create-React-WP-Theme-Folder>/react-src`
98+
`/xampp/htdocs/wordpress/wp-content/themes/<Your Theme's Root Folder>/react-src`
9899

99100
So for example, if the tutorial instructs you to edit the `src/App.js` file, then for you, that file would actually be located at:
100101

101-
`<Your-Create-React-WP-Theme-Folder>/react-src/src/App.js`
102+
`<Your Theme's Root Folder>/react-src/src/App.js`
102103

103104
### The Public Folder
104105

@@ -121,8 +122,8 @@ To configure the `Browser Refresh Server` to use SSL, follow these steps:
121122
- These instructions use the command prompt.
122123
- Assuming you've already created a theme using `create-react-wptheme`, change directory into the `react-src` folder in your theme's folder
123124
- Be sure to follow **all the instructions** under the **Usage** section at the top of this document. You need to complete the PHP portion of the setup before you can configure SSL.
124-
- Windows example: `cd C:\xampp\htdocs\wordpress\wp-content\themes\<your theme's folder name>\react-src`
125-
- Mac or \*nix example: `cd /xampp/htdocs/wordpress/wp-content/themes/<your theme's folder name>/react-src`
125+
- Windows example: `cd C:\xampp\htdocs\wordpress\wp-content\themes\<Your Theme's Root Folder>\react-src`
126+
- Mac or \*nix example: `cd /xampp/htdocs/wordpress/wp-content/themes/<Your Theme's Root Folder>/react-src`
126127
- Create a new folder to hold you're development SSL certificate and key.
127128
- All OSes: `mkdir ssl`
128129
- Change directory into the `ssl` folder
@@ -189,10 +190,10 @@ For example:
189190

190191
- Your WordPress dev server is running at http<nolink>://localhost/wordpress
191192
- the homepage setting in your main package.json file will probably work just fine.
192-
- The homepage line in your main package.json will be something like: `"homepage": "/wordpress/wp-content/themes/<your theme's folder name>"`
193+
- The homepage line in your main package.json will be something like: `"homepage": "/wordpress/wp-content/themes/<Your Theme's Root Folder>"`
193194
- But you know that your production server runs WordPress from the root: http<nolink>://mycoolblog.com/
194195
- In this case you want to remove the `/wordpress` part, so set the "homepage" line in your `user.prod.json` file to:
195-
`"homepage": "/wp-content/themes/<your theme's folder name>"`
196+
`"homepage": "/wp-content/themes/<Your Theme's Root Folder>"`
196197
- Then run `npm run build`
197198
- **Note** at this point, **your theme will appear broken on your dev server**. But it should look as expected on your production server.
198199

0 commit comments

Comments
 (0)