Reorder Author Box & After Entry Widget Area
Lab: The Loop Part 2 – Developer’s Guide to Customizing Genesis
Video Runtime: 08:25
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
.
//remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' ); | |
//add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 7 ); | |
add_action( 'genesis_after_entry', 'genesis_do_author_box_single', 11 ); | |
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); | |
add_action( 'genesis_after_entry', 'ktc_show_event_table', 1 ); | |
/** | |
* Let's look inside of the event registry table for the event name | |
* 'genesis_after_entry'. `$wp_filter` is the global variable for | |
* the event registry within the WordPress Plugin API. | |
* | |
* @since 1.0.0 | |
* | |
* @return void | |
*/ | |
function ktc_show_event_table() { | |
global $wp_filter; | |
d( $wp_filter['genesis_after_entry'] ); | |
} |
To learn more about the WordPress Event-Driven System and the Plugin API, see the following labs and Docx:
Code. Eat. Code. Sleep. Dream about Code. Code.
Episodes
Total Lab Runtime: 02:28:53
- 1 Before Entry Content Hook - genesis_before_entry_contentpro 07:13
- 2 Entry Content Overviewpro 05:49
- 3 Entry Content - Post Imagepro 10:43
- 4 Real Refactoring Examplefree 10:46
- 5 Entry Content - Post Contentpro 12:16
- 6 Entry Content - Post Content Navigationpro 13:31
- 7 Entry Content - Post Permalinkpro 09:35
- 8 After Entry Contentpro 04:16
- 9 Entry Footer - Overviewpro 07:14
- 10 Entry Footer - Post Metapro 14:07
- 11 After Entry - Overviewpro 06:01
- 12 Reorder Author Box & After Entry Widget Areafree 08:25
- 13 After Entry Widget Areapro 11:30
- 14 Turning on the Adjacent Entry Nav - Previous and Nextpro 10:09
- 15 Customize the Previous and Nextpro 06:25
- 16 After the Loop - Archive Posts Navigationpro 07:26
- 17 The Loop Else - No Posts Foundpro 01:31
- 18 Wrap it Upfree 01:56