This episode is very important. Make sure you get it! Let’s explore the relationship between WordPress and its database. You’ll look at where the content comes from in the database that populates the back-end interface for a post. You’ll explore each of the columns in wp_posts, fields in the wp_postmeta, featured thumbnail image and where it resides, and the author (which relates to the wp_users and wp_usermeta tables. You’ll learn about the glue that binds pieces of information together, such as post metadata and how these are glued to the associated record in the posts database table. The primary database […]
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.
How Does WordPress Turn off the Editor?
Let’s talk about how I found the event name to use to turn the editor back on again in the previous video. Then you’ll look at WordPress Core to see where and how it turns off the editor for the specific Posts Page. You’ll also look at WordPress Core for the function remove_post_type_support. It’s time to reverse engineer WordPress Core.
Turn on the Editor
It’s time to write the code to turn on the editor in the back-end for the Posts Page. You’ll walk through the steps, step-by-step, and discuss how to write the code.
is_front_page() vs is_home() Showdown
There is a difference between the WordPress functions is_front_page() and is_home(). The state of these functions is determined by how you (or your client) configures the site in the Settings > Reading section (in the back-end). In this lab, you will see how different settings can cause a different set of states.
Let’s Build a Blog Intro Custom Plugin
Out-of-the-box WordPress does not provide a way to introduce the Posts Page (Blog), as the editor is turned off and there is no automatic rendering of the content before the posts. In this lab, you will build a Blog Intro real-world, custom plugin which provides an introduction or welcome feature for your clients. As you build this plugin, you are learning about fetching content from the database, sanitizing, the Genesis framework, views, and more.
Prepare the Contents for the Browser
Let’s finish preparing the content for rendering out to the browser. How about if there are shortcodes in the code? How do we process those? How about using auto-formatting the paragraph HTML elements? In this episode, you will add in the do_shortcode and then wpautop.
Let’s Look in Core at
Let’s go into WordPress Core and talk about how is_home() works. You will also learn about objects and OOP in this episode, as is_home() is a wrapper around the instance of WP_Query. You can also see this hands-on lab to learn the differences between is_home and is_front_page:
How to Ensure It’s Posts Page?
You only want the contents to display (render) on the Posts Page and that’s it. In this episode, you’ll learn how to ensure you are on that page. If no, then return early and stop processing; else continue with the rendering. You will learn about clean, quality code too. You will learn about is_home.
Render (Display) the Contents
Let’s get the contents out of the database and then display (render) it onto the page in the browser. You’ll walk step-by-step through the process. You will learn about get_post.
Genesis Posts Page Archive
Let’s dive deeper into the Genesis framework by StudioPress. You will learn about: the posts page archive rendering Genesis markup and genesis_attr – overview and intent HTML attributes