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.
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.
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.
Convert the Basic WordPress Plugin into a Blog Intro Plugin
Let’s convert the basic plugin you built in Let’s Build a Basic WordPress Plugin lab into a new custom plugin called Blog Intro.
Plugin Architecture
Let’s talk about the architecture and intent. While you could build a home.php or page_blog.php template, this plugin is portable and modular. It allows you to move it from project-to-project without having to change the theme. It uses the built-in WordPress editor, which your client is used to using. We are not using a widget because widgets are cumbersome for clients. A widget does not have the editor interface. It’s not as intuitive for the site owner to figure out where to put content when you use widgets instead of the page itself.
Lab Introduction
Let me introduce the lab to you to what you will be building. Out-of-the-box for the page that is specified as the Posts Page, which is done via Settings > Reading, the editor is disabled. Why? Because WordPress does not load any content the user puts into this editor. That means whatever your client types in that editor is not rendered (sent out to the browser to display). In this lab, you will build a plugin that turns on the editor and then renders it out to the screen.
Adding and Removing Structural Wraps in Genesis
In the Genesis framework, structural wraps give you further styling control and containment of your content, as it wraps your content in a <div class=”wrap”>. You are able to specify where you want these structural wraps by configuring it within your child theme. In this lab, you will be adding and removing structural wraps by configuring the context using add_theme_support().
Customizing the Read More Link in Genesis
The Genesis framework defaults to a standard read more link which looks like [Read more…]. But what if you want to read Continue reading, Learn more, or whatever? What if you want it to be on a separate line in its own paragraph? What if you want it to look like a button instead of just a standard link? Well, then this lab is for you. In this lab, you will customize your Genesis child theme, any child theme, to fit your project’s needs. Yes, you will be doing all of these customization features.
Handling the Read More When There is No Content Limit
When you have your child theme setup to use content but there is no content limit set, your client may use the
Clean Up the Code
In this episode, let’s go into the code and clean everything up. You need to remove the temporary debug code as well as add in the PHP DocBlocks to ensure your code is fully documented. You’ll learn more about why you document your code as part of the code construction.
Style Like a Button
In this episode, you will style the read more link to look and act like a button. You will be working first in the browser, looking at the actual stylesheet, as well as making changes to see what you want. Then you’ll relate what you see in the browser to the stylesheet in your theme. Remember if you make a change to the stylesheet and this theme is already on a live site, then you need to change the child theme’s version number to ensure the changes go out to the browser. Here is the lab which walks you through […]