Welcome!
This template contains all you need to start the next great First+Third project. Click Use this template and start hacking away!
- A base theme forked from TailPress, providing frictionless Tailwind CSS support for scripts, styles, and templates.
- Support for modern CSS and JS development syntax with PostCSS and ESBuild.
- A no-nonsense, CLI-exclusive setup and build process.
- Docker integration to keep local dependencies tight-knit.
- Default configs for ESLint, Prettier, and PHPCS.
Once this template is turned into a new repository, there are a few things you'll need to do:
- Replace Client Name in the below documentation.
- In
/wp-content/themes/ft-client-theme
:- Change the folder name to the client's name or an appropriate, project-specific title.
- Replace mentions of
ft_client_theme
andft-client-theme
in thefunctions.php
file. - Update the
Theme Name
andText Domain
instyle.css
.
- In
tailwind.config.js
:- Change the
clientTheme
constant to the folder's new URI.
- Change the
- On
package.json
:- Update the package
name
to be the client's theme slug. - Search
https://github.com/firstandthird/wordpress-template-2022
and replace it with the new repo's URL. - Replace mentions of
ft_client_theme
andft-client-theme
- Update the package
Happy coding!
Warning Remove the above information and this notice before deployment!
WordPress theme for Client Name.
There are a few requirements to develop a new theme or contribute back to the project:
- Git for version control.
- Node 18+.
- NPM for managing JS dependencies.
- Composer for managing PHP and WordPress packages.
- Docker to create a local development environment.
bash
$ npm install
$ npm run initialize
$ npm run start
Note During the
initialize
step, you will be asked for ACF credentials. Use the license key for theusername
and the website URL for thepassword
. If you don't know the final production URL for the project, use https://firstandthird.com/ as the password.
Several things are handled during this step:
.env
is created based on the example file.- All NPM and Composer packages are installed and updated.
- ACF Pro is validated and installed.
- Base theme styles and scripts are compiled.
-
Access the Docker instance by going to localhost:8080. If you do not see the website, check the Ports column in Docker desktop or list running containers in your CLI to find the correct port to use (e.g. 80, 3000, 8888).
-
Follow the WordPress installation steps, log into your account, and change to the F+T Client Theme.
-
Create a page and call it "Home".
-
Go to Reading Options, set Your homepage displays to A static page, and select your new Home page.
The template includes a base theme, an empty child theme, and a src
folder for CSS, JS, and assets.
The base theme extends TailPress.io with edits to the default configuration:
- Includes
@tailwindcss/forms
and@tailwindcss/line-clamp
- Remaps the TailPress breakpoints to the Tailwind defaults
- Sets default body and header fonts
TailPress directly integrates theme.json
with the Tailwind configuration, allowing you to sync Gutenberg editor options with the website CSS.
theme.json | tailwind.config.js |
---|---|
layout | lg and xl breakpoints |
color | colors |
typography | fontSize |
The child theme template includes only the core files and imports.
Warning Only edit the base theme if absolutely necessary!
The front-end CSS and JS loaded across the website. These are the entry points for the compiler and where any extra resources should be imported.
The global CSS stylesheet; supports Tailwind syntax like @layer
and @screen
. This should be used sparingly as we prefer inline Tailwind classes to global styles, but it's recommended for setting @layer base
styles such as fonts, font sizes, container spacing, and etcetera.
The back-end CSS used to enable Tailwind styles in the Gutenberg builder. This Codex page for add_editor_style()
explains how styles target parts of the TinyMCE and Gutenberg editors.
All blocks are stored in the /blocks
folder of the client theme. Make a new folder to store your template files and name it after the block.
This theme uses the ACF 6.0 method of block templating.
The theme is designed to be backwards-compatible with ACF's acf_register_block_type()
function, but we highly recommend you refactor your v5 blocks to v6.