Welcome to the Boldist Starter! In this guide we will cover the basic developer workflow.
Advanced Custom Fields
Advanced Custom Fields (ACF) is the primary plugin that we use to interface between site content and site code. A typical workflow involves identifying sections of content within the site design that are dynamic and creating organized field groups that represent th data. The client will input data into these groups that can later be grabbed inside of the code in order to be framed and styled.
Structure
- Use 1 ACF field per page design (ex: PAGE: home), using field groups for separate parts of the page (ex: Home Hero).
- The only time we will use a flexible page builder is for the default page template (more on this later).
ACF Naming Conventions
- Use consistent and semantic prefixes using the following format — PAGE: [name of page].
- For example, when naming a new field group for the blog page use PAGE: Blog.
WordPress File Structure (pages & parts)
- Use 1 page file for each coresponding ACF page field.
- In the case where parts of a page are clearly being reused throughout the site, create a separate file in the parts folder where that code will live. Otherwise, keep all code for a page withing a single page file.
WordPress File Naming Conventions (pages & parts)
- No need for prefixes within the template-pages folder (ex: home.php).
- Use prefixes within the tempalte-parts folder (ex: component-image.php).
- We don’t want to be too granular or nit-picky about prefixes within file names. The goal is just to keep things organized as the site continues to grow.
Code Syntax
We prefer and recommend using “if { }” (bracket) syntax instead of “if : endif;” syntax. This helps maintain readability and consistency.
Use ACF group arrays and extract functions when possible
That pretty much covers the essentials. However, if further reference is needed check the WordPress docs, as well as the ACF docs.