This is the second part of the Loop. In this lab, you will explore how the remaining portion of the loop in Genesis works as well as how to customize it. You will dig into the entry content, footer, and after entry components.
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 – Post Info
Within the entry header, Genesis provides the means for each article to have additional information. They call it the byline as well as post info, as it provides additional information about this particular article. Let’s explore how Genesis builds the HTML markup and what event hooks you have available to you to customize this information. In this episode, you are exploring the genesis_post_info() function, which is found in genesis/lib/structure/post.php.
Entry Header – Post Title – Part 2
This episode continues explaining how Genesis builds the HTML markup as well as where and how you can customize each part of the markup.
Entry Header – Post Title – Part 1
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.
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 […]