Let’s explore the database in this episode. I’ll walk through how post metadata (custom fields) are related to their posts and where they live in the database. This episode is a basic overview. But to go deeper, you can do this lab:
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Project: Add a Subtitle
In this lab, you and I are going to add a subtitle to the posts. How would you do that? Where would you start? Let’s start by giving the means for the site owner or author to input the subtitle in the WordPress Post Edit interface (in the back-end). There are 2 strategies here: Use the built-in interface that ships with WordPress Build a custom meta box In this lab, we’ll use the built-in interface. Why? I want you to focus on the database and WordPress functions that interact with the database. Then in the next lab, you’ll work on […]
What is a Meta Box?
What is a Meta Box in WordPress? It’s an interface to interact with metadata. Bam, that’s it. In the back-end, WordPress has built-in meta boxes for categories, publishing, tags, and the featured image. You can build a custom one which has the HTML form fields to provide an interface to work with the custom fields (metadata). For example, this is the meta box I built for the episode configuration: What do you notice? It has a checkbox, select dropdown, and text input fields. Bingo, it’s a form with form fields. Remember what I taught you previously. Custom fields are these […]
What is a Custom Field?
We need a solid definition of what a custom field is. But we also need to know what it is, how we can use it, and why. Per WordPress codex, a custom field is: WordPress has the ability to allow post authors to assign custom fields to a post. This arbitrary extra information is known as meta-data. It goes on to say that they are key/value pairs. That’s important as we use the key to get access to the value. Per WP Beginner, a custom field is: Custom fields, also referred to as post meta, is a feature in WordPress […]
Lab Introduction
Let’s introduce you to this lab and what you will be doing. Then starting at 1:16, you’ll setup your sandbox website to be ready to do the lab with me. This will include: launching Local by Flywheel creating a new local website environment adding 2 posts into your new sandbox, using Lorem Ipsum for the dummy content Installing PHP Kint using one of these 2 plugins: 4:13: UpDevTools as a must-use plugin 8:29: PHP Kint Debugger plugin that’s in the WordPress plugin repository
How to Change the CreativeWork Microdata in Genesis to Book, Music, or Recipe
A Genesis framework developer wants to know: How do I change the “CreativeWork” microdata in Genesis to Book, Music, or Recipe? In this episode, Tonya talks about strategies to find where Genesis sets the microdata attribute and then how to change it to fit your needs.