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.
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.
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.
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:
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 […]
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.
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
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.
At the bottom of each article, you are used to seeing the post meta. This is where Genesis, by default, renders out the post’s category(ies) and tag(s). This functionality occurs in the function genesis_post_meta in the file “genesis/lib/structure/post.php”. Part of this function, just like with the post info, the shortcodes are being filtered by an event, which is named genesis_post_meta, and then processed through the WordPress Core function do_shortcode(). This is the filtering event which fires to call any functions that are pre-registered to the event name genesis_post_meta: $filtered = apply_filters( ‘genesis_post_meta’, ‘ ‘ ); Within Genesis, it has registered […]
After the entry content and still within the <article>, Genesis provides the ability to display additional content. This is the entry footer section. By default, Genesis will render out the post categories and post tags and the post meta. In this episode, you see each of the callbacks which are registered to build the entry footer HTML markup. The event name for this section is genesis_entry_footer.