Welcome to the WordPress Block Theme Starter! This theme is a modern, block-based theme utilizing the latest WordPress theming standards. Below, you'll find detailed instructions on how to set up and work with this theme.
- Block-Based: Built entirely using WordPress blocks, providing a seamless and flexible editing experience.
- Modern Tooling: Utilizes
@wordpress/scripts
packages to handle the compilation of theme assets. - Development Workflow: Easy to set up and start developing with
yarn
, allowing for efficient asset management and compilation.
- Node.js (version 18.x or later)
- Yarn (version 1.x or later)
-
Clone the repository:
git clone <repository-url>
-
Navigate to the theme directory:
cd /wp-content/themes/wp-block-theme-starter
-
Install project dependencies:
yarn
You will need to create a .env
file in the root directory of your theme. Inside this .env
file, you should include the variable WP_LOCAL_URL
. The value of WP_LOCAL_URL
should match the local URL of your local WordPress site. This is necessary for local development.
WP_LOCAL_URL=http://example.local
To start developing and watching the theme for changes, use the following command:
yarn dev
This command will compile the theme assets and watch for any changes, re-compiling as necessary. It also sets up a development server with hot module replacement for a seamless development experience.
You can also use:
yarn start
This command functions similarly to yarn dev
, compiling the theme assets and watching for changes, re-compiling as necessary.
To compile the theme assets for production, use the following command:
yarn build
This command will create optimized, minified assets suitable for a live environment.
yarn dev
: Starts the development server, compiles the theme assets, and watches for changes with hot module replacement.yarn start
: An alias foryarn dev
, providing the same functionality.yarn build
: Compiles and optimizes the theme assets for production.
- Activate the Theme:
- Once you have compiled the theme assets, upload the theme directory to your WordPress installation's
wp-content/themes
directory. - Activate the theme from the WordPress admin dashboard.
- Once you have compiled the theme assets, upload the theme directory to your WordPress installation's
- Customize the Theme:
- Use the WordPress Block Editor to create and customize your pages and posts with ease.
Reference the official WordPress theme handbook chapter Build Process for more details on the build process.
For any issues or questions, feel free to contact our support team at support@prolificdigital.com.