Skip to content
Jo Dickson edited this page Mar 29, 2021 · 7 revisions

What are these files?

This template repo is a boilerplate set of files for WordPress child themes, for use in projects created by UCF Communications and Marketing (specifically, UCF Web Communications/Webcom). It includes an opinionated set of build tool and linter configurations for rapid development of minified, optimized theme assets that follow our team's code standards.

The provided files assume the UCF WordPress Theme is the parent theme, but this can be modified as needed.

How to create a new theme repo

To ensure our projects are created with the latest configurations and README information, CM devs should create new child theme projects from this repo. Use the guide below to get started:

Instructions:

  1. Create a new repo in Github using this template.

  2. Pull down your new repo into your local development environment.

  3. Replace {{My-Project}} and {{My Project}} placeholders throughout the template files.

    {{My-Project}} corresponds to the the slug of your project on Github, e.g. Main-Site-Theme.

    {{My Project}} should be replaced with the human-friendly name of your project, e.g. Main Site Theme.

    You can perform a couple of project-wide find+replace commands in your IDE/editor to do this quickly.

  4. In all included PHP files, update the default namespace name MyProject to a name that's unique and appropriate for your project, e.g. MainSite.

  5. In includes/config.php and includes/meta.php, update the MYPROJECT_ constant prefixes to use a prefix that's unique and appropriate for your project, e.g. MAINSITE_.

  6. In includes/meta.php, update the myproject_ prefix used in the functions provided in the file to use a prefix that's unique and appropriate for your project, e.g. mainsite_. Remember to also update references to functions used in action/filter hooks!

That's it! From here, continue developing your theme as you would normally. Remember to fill in the remaining placeholder information for your project in the README, CONTRIBUTING doc, and other files! (You can do a project-wide search for {{ to locate all of these placeholders.)

Post-setup checklist:

In addition to setting up your new project on Github using these files, remember to also do the following for all new projects. Some parts of our project documentation depend on the following existing:

Things to know / project assumptions

Projects generated using these template files assume the following:

  • The child theme assumes the UCF WordPress Theme is the parent theme.
  • The child theme's generated stylesheet and javascript files are enqueued for you (see includes/meta.php). They are enqueued with UCF WordPress Theme assets listed as dependencies to ensure assets are loaded in the correct order. If your child theme requires extra stylesheets or scripts, you'll need to enqueue them yourself in this file.
  • Minified css and js will be saved to static/.
  • The Athena Framework's variables and mixins are imported into the main theme Sass file. The child theme assumes the UCF WordPress Theme's stylesheet gets loaded in, which includes the Athena Framework, so including the entire framework in the child theme is unnecessary.
  • style.css is NOT a registered stylesheet, in favor of static/css/style.min.css.
  • If ACF is a required plugin, its field config should be saved to dev/acf-config.json.