With CSS, you can visually hide certain elements in the DOM. CSS provides the display property, where you can set it’s value to none. What happens? It removes the HTML element from the visual representation for the web page. To accomplish this in Genesis, you will want to open up your editor and then do these steps: Open the style.css file Search for the .site-footer { section in the stylesheet Scroll down to the end of that section to place the code after these styles And then put in the following CSS declaration block Notice that we are targeting the […]
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.
Lab Introduction
Let me introduce this hands-on code building lab to you. You and I are going to build this lab together. Our goal is to remove the site footer from your Genesis child theme. We’ll build four (4) different implementations which accomplish virtually the same result. We’ll talk about the pros and cons of each strategy and when to use one over the other. It’s best that you do this lab with me. You will learn more when you actually write the code, explore the Genesis framework with me, and see what happens as you make changes. Instead of just watching […]
Remove the Genesis Site Footer on Home Page
Let’s remove the default Genesis site footer on the posts’ page, i.e. the home page. In this hands-on lab, you will walk through four (4) different implementations, each of which removes the site footer. You’ll discover the pros and cons of each of these approaches. From this exercise, you’ll be able to select the best approach for your specific needs.
Wrap it Up
Way to go! You just built a new feature into your Team Bios plugin. You learned how easy it is to configure and register custom taxonomy. You learned how to bind it to multiple post types. You even got a couple of lessons in PHP string building. Whew, you did it! Now let’s push your new plugin up to your GitHub repository. We will continue building this plugin in other labs including adding custom fields (metadata) and meta boxes to it for team attributes like title, social media links, etc. Get it on GitHub
Flush Rewrite Rules
You learned in the Custom Post Type Basics lab that you need to flush the rewrite rules when registering a custom post type. You need to do it for a custom taxonomy too. Remember, never ever ever do it after you register. Listen to me. It’s too expensive and will slow down your website. The proper way is to do it when the plugin is activated. In this episode, let’s add our taxonomy registration function to the plugin’s activation handler. Then we’ll deactivate and test. Let me show what it does. Next, let’s add the handler for when a plugin […]
Configuring Arguments
Let’s walk through the rest of the configuration arguments available from WordPress. We’ll turn them on and off to see what they do. You’ll also discover just how easy it is to add the terms to the post type’s table in the backend.
Bind to Post Types
So far you’ve bound the custom taxonomy to just one post type, i.e. our “team-bios” custom post type. But what if you want to assign it to multiple post types? For example, what if your client wants to assign departments for some of their blog posts? Think about it. Maybe they will write news and press releases and they want to group it by the department. In this episode, let’s assign our new custom taxonomy to both the “team-bios” and “post” post types. We’ll also talk about interfaces and what’s really going on. The back-end is just an interface that […]
Configure the Labels
In the last episode, you and I registered a custom taxonomy with the minimum configuration. But look at the taxonomy interface in the back-end. What do you see? The top of the page says “Departments” but the rest of the interface says “Category.” Hum, do you think that will confuse your customer? Yes, it will. One of our jobs as a WordPress developer is to make the interface as easy to use as possible. That means we need to make sure the labels are right, instructions are clear, and the entire interface is clear and self-supporting. You don’t want them […]
Registering a Custom Taxonomy
Let’s register our custom WordPress taxonomy. We are going to call it “department” as we need to group our team biographies by departments. You will be amazed at how easy it is to register a custom taxonomy. Seriously. A couple lines of code and Bam, it’s done. Here’s the code for the bare minimum configuration requirements: You register a callback to the init event (see the full code file below). Then it’s a couple lines of code to configure the taxonomy. Notice that this one is configured as hierarchical, just like the built-in categories. In this episode, you’ll walk through […]
Custom Taxonomy – The What, Why, and When
In this episode, you will learn about what makes a taxonomy a custom one. We’ll discuss the what (what is it), why (why you want to use it), and when (when you want to use it versus the built-in taxonomies).