Overview
Below are all of the action hooks currently available where you can position a content block. These hooks are broken into five categories: Document Head Hooks, Structural Hooks, Loop Hooks, Comments Hooks, and WordPress Core Hooks. A fantastic reference for visualizing these hooks is the Genesis Visual Hook Guide.
Document Head Hooks
Hook Name | Description |
---|---|
genesis_title | This hook executes between tags and outputs the doctitle. You can find all doctitle related code in /lib/structure/header.php. |
genesis_meta | This hook executes in the section of the document source. By default, things like META descriptions and keywords are output using this hook, along with the default stylesheet and the reference to the favicon. This hook is very similar to wp_head |
Structural Hooks
Hook Name | Description |
---|---|
genesis_before | This hook executes immediately after the opening tag in the document source. |
genesis_before_header | This hook executes immediately before the header (outside the #header div). |
genesis_header | By default, this hook outputs the header code, including the title, description, and widget area (if necessary). |
genesis_header_right | This hook executes immediately before the Header Right widget area inside div.widget-area. |
genesis_after_header | This hook executes immediately after the header (outside the #header div). |
genesis_site_title | This hook executes immediately after the opening tag in the document source. |
genesis_site_description | This hook executes immediately before the closing tag in the document source. |
genesis_before_content_sidebar_wrap | This hook executes immediately before the div block that wraps the content and the primary sidebar (outside the #content-sidebar-wrap div). |
genesis_after_content_sidebar_wrap | This hook executes immediately after the div block that wraps the content and the primary sidebar (outside the #content-sidebar-wrap div). |
genesis_before_content | This hook executes immediately before the content column (outside the #content div). |
genesis_after_content | This hook executes immediately after the content column (outside the #content div). |
genesis_before_sidebar | This hook executes immediately before the primary sidebar column. |
genesis_sidebar | This hook outputs the content of the primary sidebar, including the widget area output. |
genesis_after_sidebar | This hook executes immediately after the primary sidebar column. |
genesis_before_sidebar_widget_area | This hook executes immediately before the primary sidebar widget area (inside the #sidebar div). |
genesis_after_sidebar_widget_area | This hook executes immediately after the primary sidebar widget area (inside the #sidebar div). |
genesis_before_sidebar_alt | This hook executes immediately before the alternate sidebar column. |
genesis_sidebar_alt | This hook outputs the content of the secondary sidebar, including the widget area output. |
genesis_after_sidebar_alt | This hook executes immediately after the alternate sidebar column. |
genesis_before_sidebar_alt_widget_area | This hook executes immediately before the alternate sidebar widget area (inside the #sidebar-alt div). |
genesis_after_sidebar_alt_widget_area | This hook executes immediately after the alternate sidebar widget area (inside the #sidebar-alt div). |
genesis_before_footer | This hook executes immediately before the footer, outside the #footer div. |
genesis_footer | This hook, by default, outputs the content of the footer, including the #footer div wrapper. |
genesis_after_footer | This hook executes immediately after the footer, outside the #footer div. |
genesis_after | This hook executes immediately before the closing tag in the document source. |
Loop Hooks
Hook Name | Description |
---|---|
genesis_before_loop | This hook executes immediately before all loop blocks. Therefore, this hook falls outside the loop, and cannot execute functions that require loop template tags or variables. |
genesis_loop | This hook outputs the actual loop. See lib/structure/loop.php and lib/structure/post.php for more details. |
genesis_after_loop | This hook executes immediately after all loop blocks. Therefore, this hook falls outside the loop, and cannot execute functions that require loop template tags or variables. |
genesis_after_endwhile | This hook executes after the endwhile; statement in all loop blocks. |
genesis_loop_else | This hook executes after the else : statement in all loop blocks. |
genesis_before_entry | This hook executes before each entry in all loop blocks (outside the post_class() container). |
genesis_entry_header | This hook executes before the entry content and generates the entry header content in all loop blocks. |
genesis_before_entry_content | This hook executes before the .entry-content container in all loop blocks. |
genesis_entry_content | This hook executes within the .entry-content container in all loop blocks. |
genesis_after_entry_content | This hook executes after the .entry-content container in all loop blocks. |
genesis_entry_footer | This hook executes after the entry content and generates the entry footer content in all loop blocks. |
genesis_after_entry | This hook executes after each entry in all loop blocks (outside the post_class() container). |
Comment Hooks
Hook Name | Description |
---|---|
genesis_before_comments | This hook executes immediately before the comments block (outside the #comments div). |
genesis_comments | This hook outputs the entire comments block, including the section title. It also executes the genesis_list_comments hook, which outputs the comment list. |
genesis_list_comments | This hook executes inside the comments block, inside the .comment-list OL. By default, it outputs a list of comments associated with a post via the genesis_default_list_comments() function. |
genesis_after_comments | This hook executes immediately after the comments block (outside the #comments div). |
genesis_before_pings | This hook executes immediately before the pings block (outside the #pings div). |
genesis_pings | This hook outputs the entire pings block, including the section title. It also executes the genesis_list_pings hook, which outputs the ping list. |
genesis_list_pings | This hook executes inside the pings block, inside the .ping-list OL. By default, it outputs a list of pings associated with a post via the genesis_default_list_pings() function. |
genesis_after_pings | This hook executes immediately after the pings block (outside the #pings div). |
genesis_before_comment | This hook executes before the output of each individual comment (author, meta, comment text). |
genesis_after_comment | This hook executes after the output of each individual comment (author, meta, comment text). |
genesis_before_comment_form | This hook executes immediately before the comment form, outside the #respond div. |
genesis_comment_form | This hook outputs the actual comment form, including the #respond div wrapper. |
genesis_after_comment_form | This hook executes immediately after the comment form, outside the #respond div. |
WordPress Core Hooks
Hook Name | Description |
---|---|
wp_head | This hook executes within the section of the document source. |
wp_footer | This hook executes near the tag of the document source. |