You will start looking at the media queries for the menu styles. We start down the direction of pulling those into the base, but then quickly realize that the .js styles need their own partial file. You will work with Tonya through the process of thinking about how to port the styles over into the new theme. She discusses different strategies and ways of laying out the media queries within the navigation module. Then you will begin refactoring. See if you can do this task on your own. Then work with Tonya to see different ways to refactor. This episode, […]
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
In this lab, you and I are going to finish the navigation module by bringing in the media queries, pagination, and more.
Wrap it Up
Oh man, your head should be huge now as you learned so much in this 5 hour, two-part hands-on lab. But the Loop is the key concept in WordPress. I’m proud of you and here’s a personal message from me to you.
The Loop Else – No Posts Found
If there are no posts available for the criteria, you want a message to alert the reader. Genesis provides you with both an event called genesis_loop_else and a function genesis_do_noposts which provides this message. You can customize the message by using the filter genesis_noposts_text.
After the Loop – Archive Posts Navigation
On archive pages, such as the Posts Page, you want a way to navigate to the additional posts. Genesis provides pagination in two different formats: previous and next links or numeric. You select what you want in the Genesis > Theme Settings > Content Archives meta box. Let’s walk through this code.
Customize the Previous and Next
Now you know how to turn on the previous and next links. In this episode, you will be customizing it by changing the previous link text, adding a class attribute, and moving the post title to another line. Here is the code you will build and I will explain in this episode:
Turning on the Adjacent Entry Nav – Previous and Next
After the article, you want to give readers the ability to discover more content easily and quickly. One technique is to use the Previous and Next links which allow the reader to navigate to the adjacent content. Genesis provides the functionality to use these links, but it is not enabled. Nope, you need to turn it on in your child theme. This episode walks you through two different ways to turn on it, as well as you will walk through the code. Note: The comment in the DocBlock of Genesis says to use a priority of 10 or less to […]
After Entry Widget Area
Let’s go through the function genesis_after_entry_widget_area() in Genesis, as it is responsible for building and then rendering out the widgetized area for the “after entry widget area.” You’ll explore how the ! operator in PHP works as well as looking at the conditions which say, Yes let’s go ahead and render it out. For the customization part of this episode, you will walk through different techniques to turn off (remove) this component. Let’s say you don’t want the after entry widget area in your theme. Ok, this episode discusses how to properly disable and remove this component.
Reorder Author Box & After Entry Widget Area
Let’s do some customization by reordering the author box and after entry widgetized areas. I’ll show you two different ways to move these components such that the author box is after the widgetized area. You’ll also learn about why you need to unregister the Genesis callback by using remove_action, as you see the callbacks in the WordPress Core Plugin API’s event registry table, which is stored in the global variable $wp_filter. To learn more about the WordPress Event-Driven System and the Plugin API, see the following labs and Docx: WordPress Plugin API – Introduction & Registering Events add_action remove_action do_action
After Entry – Overview
Right the <article> is closed, Genesis provides you with the genesis_after_entry event hook. Out-of-the-box, the framework adds the following components: Author Box After Entry Widgetized Area Previous and Next Navigation (adjacent entry nav) Comments You can see the execution order within the Genesis loop here: In this episode, you’ll walk through the codebase to get an overview of the above components.