Building Custom Themes

Scared person cringing behind keyboard
Scared employee By: olly Source: Adobe Stock https://new.express.adobe.com/id/urn:aaid:sc:US:571deb3b-1b1e-4a11-b614-5eed77604144?category=media&tab=photos&q=fear

When I first reviewed the Key Assignments and Deliverables for Lesson 08, my first reaction was, “I am toast”. Fear and trepidation crept in when I saw HTML, PHP, and CSS, as I can barely type those terms let alone use those tools to develop a theme. Those feelings were further exacerbated when early in Chapter Nine, I read:

All you will need before we get started is the following:

  • Your own website design
  • The ability to slice and dice your design to turn it into an HTML structure (Krõl, 2019)

Diving in, I found that in the world of WordPress there are tools to help you along the way and there are three paths to theme development.

Building a Theme from Ground Up

Software computer programming code By: Sergey Mironov Source: Adobe Stock https://new.express.adobe.com/id/urn:aaid:sc:US:571deb3b-1b1e-4a11-b614-5eed77604144?category=media&tab=photos&q=computer+code

While supposedly educational, it can be very time-consuming and ineffective. For me it would require additional learning (coding skills) to develop a theme, let alone keeping it up to date with WordPress and plugin updates. This is definitely not for me with my current skill level.

Building a Theme with a Framework

Code compilation in 3d with a digital structure being built block by block each representing a different function or algorithm By: Melanie Source: Adobe Stock https://new.express.adobe.com/id/urn:aaid:sc:US:571deb3b-1b1e-4a11-b614-5eed77604144?category=media&tab=photos&q=computer+code+building+blocks

As alluded to earlier, the WordPress environment is updated frequently, and themes require review and maintenance or updating. Using a framework removes some of that burden as they are frequently updated to keep abreast of those changes.

I reviewed “Gantry,” one of the free theme frameworks, to see what the concept is. It reminded me of a Lego set allowing me to build anything of which I could think. Similar to a set of drag and drop features.

Drawbacks to using a framework are they tend to be large pieces of software, and the learning curve might be steep. In addition. If you want or need to change to a different framework, you will need to learn a new piece of software. Again, not for me. I think the learning curve and “time to market” need for a website would be a negative.

Building a Theme with a Started Theme

Web Hosting Concept: Finger Pressing a Digital Button for Server and Website Solutions, Cloud Technology, and Online Business Infrastructure By: Design Stock Source: Adobe Stock https://new.express.adobe.com/id/urn:aaid:sc:US:571deb3b-1b1e-4a11-b614-5eed77604144?category=media&tab=photos&q=wordpress

Starter themes provide solution that bridges the gap between building from the ground up a using a framework. They are kept current and optimized for WordPress. This provides freedom to design based on a solid backbone. (Krõl, 2019)

For me, this is my optimum solution for creating my own custom theme.

Tools and Requirements

How do we go from nothing, “a blank screen,” to a working basic theme. First, it starts with a design. Creating a wireframe helps define the elements desired in your theme such as:

  • Header
  • Footer
  • Main Column
  • Sidebar

These basic elements are the roadmap to turn your concept into code and WordPress has minimal file requirements to create a functioning basic theme. Index.php and style.css are the only two required files and additional files help define the structure and appearance.

  • index.php: This serves as main template file for the theme and is the fallback for pages or posts that have no specific template file defined.
  • style.css: This contains styling rules for the visual appearance of your site. It contains header information as well as author, version, and description.
  • screenshot.png: While not a code file, this provides a visual representation of the theme in the theme selection interface.
  • functions.php: This adds custom functionality for features like menus, custom backgrounds, custom widgets as well as other features.
  • header.php: This contains HTML for the header section along with elements like site title, navigation menu, and a logo.
  • footer.php: This contains HTML for closing, copyright info, widgets, or other footer content.

In the End

Wading in water
Experiencing Joy Through Splashing Water While Wading in a Serene River in Summer By: V.Semeniuk Source: Adobe Stock https://new.express.adobe.com/id/urn:aaid:sc:US:571deb3b-1b1e-4a11-b614-5eed77604144?category=media&tab=photos&q=feet+wading

As I waded through the assignment you did an excellent job of easing me into basic code editing and theme development. Not trusting myself, I installed Local by Flywheel so I could test my theme and edits before sending to via FTP to my IONOS site.

Hopefully, the end result meets the requirements.

References

Krõl, K. (2019). WordPress 5 Complete. Packt Publishing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.