Part of each article is its title. In this episode, you will explore how Genesis builds the HTML markup, determines whether to wrap it in an <h1> or <h2> tag in order to make it SEO ready, and what filter events are available for you to do your customization thang. This episode walks you through each spot where you can customize. It includes some tips and tricks, as well as shortcode or two.
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.
Entry Header Hook – genesis_entry_header
The entry header provides the HTML markup for the start of the article. Out of the box, it includes the opening and closing markup, the title, and post info (i.e. author and date). Let’s explore removing, reordering, and customizing the entry header area on the posts page to see what this event does. In this episode, you will explore the WordPress Event Registry look-up table to see how callbacks are ordered within it. It is vital that you understand this event-driven system, how the priorities work, and what happens when two callbacks have the same priority number. If you need […]
Before the Entry Hook – genesis_before_entry
At the start of the loop, meaning just after the while fires, the Genesis event genesis_before_entry fires. This event gives you the hook to do things such as add content or a feature before each article is rendered or to reset the loop. Let’s explore this event to see what it does and how you might use it in your projects.
Before the Loop Hook – genesis_before_while
Before the loop begins, which starts with the while, there may be times when you want code to run. A good use case is when you want to reorder, remove, or add features that will render during the loop. The key to using this Genesis event is that you want it run only if there are posts, meaning only if the loop is going to run. Let’s explore the Genesis event: genesis_before_while.
Standard Loop and WordPress Core
Okay, I think you need to go deeper into understanding what is happening in the Loop between Genesis and WordPress. Let’s walk through what WP_Query is doing when you loop through and call it’s have_posts() and the_post().
Standard Loop Overview – Part 2
Let’s continue walking through the standard loop. You will learn about PHP while() function and dive into WordPress Core to look at the WP_Query method the_post().
Standard Loop Overview – Part 1
The standard loop is responsible for looping through the content WordPress pulled out of the database for this web page. Genesis’ standard loop fires each of the events as it builds up the HTML markup that is rendered out onto the web page. This is where the entry code is processed including the entry header, entry content, post info, post meta, and more. In this episode, you will start walking through the standard loop in Genesis to see how and why it interacts with WordPress. You will dive into WordPress Core to discover what’s behind the function have_posts(). You will […]
Genesis Do Custom Loop – Part 2
This episode continues exploring the custom loop. You’ll be learning about the PHP constructs: str_replace explode You’ll also see what paged does and walk through the rest of the custom loop code. This episode shows you how the PHP code works as well as why it’s written the way it is. You’ll even take a look at what data is present in the global variable $wp_query and how it changes after we generate the custom loop.
Genesis Do Custom Loop – Part 1
In the Genesis function genesis_do_loop, the code makes the choice of whether to do a custom loop or the standard one. If this page to be built has the template selected to “Blog”, which is the page_blog.php, then the custom loop is used. Why? Because it allows your client (and you) to utilize the Theme Settings for the Blog Page Template settings. For example, you may have it configured as follows: Why? It allows you to customize what you want displayed on the Posts Page, that page which displays all of the posts, sometimes labeled as the Blog. When you […]
Calling the Loop Overview
How does Genesis call The Loop? What HTML markup does it render out to the browser? In this episode, you will look at the lib/framework.php file, where the event genesis_loop is fired. You’ll compare that to the actual HTML markup to correlate the code to what the browser receives. Then you’ll take your first look at the looping functionality found in the file lib/structure/loops.php.