How (and Why) to Build a Base WordPress Theme

Brian Gardner Avatar

·

Forking a WordPress Theme

Navigating the evolving WordPress landscape and its theme infrastructure can be daunting, particularly when developing a custom theme from scratch. However, the open-source nature of WordPress provides agencies with the valuable option of forking an existing theme.

Building a base WordPress theme offers many benefits that can substantially enhance an agency’s offerings. This article will detail these advantages and demonstrate the process of effectively forking a theme to achieve the desired outcomes for both agencies and clients.

We will also present a comprehensive tutorial on how to successfully fork Frost, a powerful and adaptable Full-Site Editing theme by WP Engine.

Feel free to watch the video version of this article or continue reading.

Open Source and the GPL

The GPL (General Public License) is a free, open-source software license used by WordPress and many other software applications. WordPress is released under the GPL, meaning anyone can use, modify, and distribute the code if their modifications are available under the same license.

The GPL license for WordPress is crucial because it allows anyone to contribute to the software and ensures it will always remain free and open to the public. The license has been a fundamental part of WordPress’s success. It has allowed developers worldwide to work together to create a powerful, flexible, and highly customizable content management system used by millions of websites worldwide.

Moreover, the GPL license permits developers to “fork” WordPress derivatives such as plugins and themes. The forking process enables users to modify the existing codebase—creating a new version with specific customizations and enhancements. It’s a great course of action for builders.

Forking a WordPress Theme

Forking is an essential and dynamic aspect of the WordPress ecosystem, crucial in its growth and evolution. It encourages collaboration and fosters a culture of sharing and knowledge transfer. It allows developers to learn from one another’s work, improve on existing solutions, and build upon the collective expertise of the WordPress community.

WordPress Usage Growth
WordPress Usage Statistics

It also offers developers and designers the flexibility and creative freedom to experiment with WordPress source code, modifying it to create new and innovative solutions that enhance its capabilities.

Themes are an integral part of the WordPress ecosystem. They offer developers and designers a platform to experiment with various visual design styles, layout options, and functionality enhancements—resulting in diverse outcomes, including innovative product ideas and opportunities for agencies to leverage and optimize their workflow.

An Anecdote: Avalanche Studio

There are numerous persuasive arguments for agencies to consider forking a WordPress theme to create a tailored version that caters to client needs. Here’s an example of how building a boilerplate can help an agency thrive.

. . .

In the highly competitive world of web development, Avalanche Studio, a notable WordPress agency, sought to differentiate itself. Composed of a skilled team of developers and designers, they took a strategic approach by forking the Frost theme as their foundation for client sites to achieve this.

Three key reasons drove this decision to build a base theme:

Unparalleled Customization: Avalanche Studio aimed to provide each client with a unique digital presence that would distinguish them from competitors. By forking Frost, the agency could make extensive modifications and tailor the design to each client’s needs—ensuring that every website build was distinct and tailored to the client’s brand.

Enhanced Efficiency: Utilizing a customized base theme allows the team to optimize the development process by including only the features and functionalities required for clients. This streamlined approach empowers Avalanche Studio to deliver websites more quickly and cost-effectively.

Future-Proof Flexibility: By forking Frost, Avalanche Studio kept its codebase current and could quickly update it, better serving clients. This adaptability lets them stay on top of web design trends, providing clients with tailored, cutting-edge solutions.

By building a base WordPress theme, Avalanche Studio thrived in an ever-changing industry, demonstrating the power of strategic customization, streamlined processes, and adaptability. By forking Frost, they differentiated themselves from the competition and set a new benchmark for excellence in web design and client satisfaction.

Build a Base WordPress Theme Using Frost

As mentioned above, our Developer Relations team at WP Engine has created Frost to facilitate the community’s transition into the modern era of WordPress block themes. In addition, this sleek, minimalist theme fully embraces the capabilities of Full Site Editing.

Frost WordPress Theme
Frost is the ultimate WordPress theme for website builders.

The Frost theme provides an enchanting user experience for production-grade WordPress websites while also serving as a robust foundation for development by agencies and product creators.

To properly fork the Frost WordPress theme, follow the steps below. In this example, we’ll replace all instances of frost with mytheme. Note that you can call it whatever you want, but you must visit Appearance > Themes to reactivate the new theme.

Step #1 – Update the theme folder name.

Change the theme’s folder name from /frost/ to /mytheme/.

Step #2 – Update the style.css file header.

Open the style.css file in Frost to see this code:

/*
Theme Name: Frost
Theme URI: https://frostwp.com/
Author: WP Engine
Author URI: https://wpengine.com/
Description: With its clean, minimal design and powerful feature set, Frost enables agencies to build stylish and sophisticated WordPress websites.
Tags: accessibility-ready, block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, full-site-editing, one-column, template-editing, threaded-comments, translation-ready, wide-blocks
Requires at least: 6.2
Tested up to: 6.2
Requires PHP: 5.6
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: frost

Frost WordPress Theme, (C) 2022-2023 WP Engine.
Frost is distributed under the terms of the GNU GPL.
*/
Code language: JSON / JSON with Comments (json)

There are several mentions of Frost, so be sure to replace each one. An example of what this would look like using mytheme name would be:

/*
Theme Name: My Theme
Theme URI: https://mytheme.com/
Author: Your Name
Author URI: https://yourdomain.com/
Description: My theme that I created after forking Frost.
Tags: accessibility-ready, block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, full-site-editing, one-column, template-editing, threaded-comments, translation-ready, wide-blocks
Requires at least: 6.2
Tested up to: 6.2
Requires PHP: 5.6
Version: 0.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mytheme

My Theme WordPress Theme, (C) 2023 Your Name.
My Theme is distributed under the terms of the GNU GPL.
*/
Code language: CSS (css)

Step #3 – Update the function names in functions.php.

Open the functions.php file in Frost to see code like this:

// Enqueue style sheet.
add_action( 'wp_enqueue_scripts', 'frost_enqueue_style_sheet' );
function frost_enqueue_style_sheet() {

	wp_enqueue_style( 'frost', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );

}
Code language: PHP (php)

There are several mentions of Frost, so be sure to replace each one. An example of what this would look like using mytheme name would be:

// Enqueue style sheet.
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_style_sheet' );
function mytheme_enqueue_style_sheet() {

	wp_enqueue_style( 'mytheme', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );

}
Code language: PHP (php)

Step #4 – Update the file header in pattern files.

Open the /patterns/ directory in Frost to see the theme patterns. Each one has a header file with a Slug: definition that should be updated.

<?php
/**
 * Title: Header with site title, navigation.
 * Slug: frost/header-default
 * Categories: header
 * Block Types: core/template-part/header
 */
?>
Code language: HTML, XML (xml)

An example of how this should look like using mytheme name would be:

<?php
/**
 * Title: Header with site title, navigation.
 * Slug: mytheme/header-default
 * Categories: header
 * Block Types: core/template-part/header
 */
?>
Code language: HTML, XML (xml)

Step #5 – Update the theme screenshot.

Open the root directory in Frost and replace the screenshot.png file (1200px × 900px) that is used as the theme screenshot.

Conclusion

In conclusion, the ever-changing WordPress landscape and theme infrastructure can be challenging, especially when creating a custom theme from the ground up. However, the open-source nature of WordPress presents agencies with the invaluable opportunity to fork existing themes.

A base theme can significantly elevate an agency’s offerings. This article has explored these benefits in-depth and illustrated the process of effectively forking a theme to achieve the best possible results for agencies and clients.