As a kid I loved going to the pool. Actually I loved water in general. I was raised all over the world including Japan, Guam, and California. This meant I spent a lot of my time at the beach or in pools. Not long after moving to Oklahoma we got to go the to local pool. It was burning hot and I missed the California beaches, but the pool was great. I went 2-3 times a week and made a lot of summer friends by the water.
Our pool had 2 diving boards. The low board was just a few feet above the water and we would line up to do cannon balls, belly flops, and ninja dives. You may not know what a ninja dive is. Basically it is what 8 year olds who have watched too many kung fu movies do when they are trying to reenact the wire fu kicks and flips seen in movies like Crouching Tiger Hidden Dragon, but from a diving board.
The problem with ninja dives from the low dive is you only have a split second to strike a pose, not quite the Teenage Mutant Ninja Turtles kind of stuff we were going for.
Weeks into the summer we were daring each other to try the high dive. To an 8 year old it was about a million feet tall so none of us would do it. Still, the thought of having all those seconds of free fall to put on a series of legendary arial acrobatics … it was tempting. Eventually I had psyched myself up enough to climb the thousands of steps and edge out to the end of the board. I literally crawled out then looked down. Everyone was watching so I sucked it up and stood. The board twitched and wobbled with each step as bigger kids yelled for me to hurry up. I stood on the edge and felt my stomach heave and then stepped into history.
All of us had been anticipating that moment, and for my 8 year old self it was everything I wanted it to be. After that everyone lined up and we never looked back on that low dive.
That is how I feel about Genesis 2.0 and HTML5. It is so exciting. I feel like we have been in a holding pattern for ages to bring these changes out, but it will be so worth it and I know I’ll never go back to the XHTML markup.
Back in May of 2011 I started my Genesis Explained series so it is appropriate that May 2013 is the start of the Genesis 2.0 series. In that initial article I explained that working with Genesis is a lot like working with Legos (another child hood memory). Through the course of the series I tried to teach how actions work, what filters do, and how fledgling developers can learn to read the code in the various files to learn and adapt.
That information is largely still valid and I don’t plan on removing it. Through Genesis Explained Two series I will be referencing the original Genesis Explained series for added details. I will also be going back to edit the original series to point to the new articles where appropriate. If you already know Genesis you will find Genesis 2.0 extremely comfortable. If you are just getting started and want to learn more while I am writing this new series, then take time to go check out the original Genesis Explained Series. It won’t steer you wrong.
I’ve already referenced the first article of Genesis Explained, but if you have not read it I’d recommend going back and reading it now. Now that you are familiar with the basic concept behind Genesis I’d like to cover the new hooks. I’ll be going back and looking at the framework.php file from Genesis 2.0 later. There is a new function I need to explain, but don’t worry, I won’t forget.
So, on to the complete hook reference for all Genesis 2 hooks:
Init.php
- genesis_pre
- genesis_pre_framework
- genesis_init
- genesis_setup
Header.php
- genesis_doctype
- genesis_title
- genesis_meta
- genesis_before
- genesis_before_header
- genesis_header
- genesis_site_title
- genesis_site_description
- genesis_header_right
- genesis_after_header
Framework.php
- genesis_before_content_sidebar_wrap
- genesis_before_content
- genesis_before_loop
- genesis_loop
HTML5
- genesis_before_entry
- genesis_entry_header
- genesis_before_entry_content
- genesis_entry_content
- genesis_after_entry_content
- genesis_entry_footer
- genesis_after_entry
XHTML
- genesis_before_post
- genesis_before_post_title
- genesis_post_title
- genesis_after_post_title
- genesis_before_post_content
- genesis_post_content
- genesis_after_post_content
- genesis_before_post_title
- genesis_after_post
Comments.php
- genesis_before_comments
- genesis_comments
- genesis_list_comments
- genesis_before_comment
- genesis_after_comment
- genesis_before_comment
- genesis_after_comment
- genesis_list_comments
- genesis_after_comments
- genesis_before_pings
- genesis_pings
- genesis_list_pings
- genesis_before_comment
- genesis_after_comment
- genesis_before_comment
- genesis_after_comment
- genesis_list_pings
- genesis_after_pings
- genesis_before_comment_form
- genesis_comment_form
- genesis_after_comment_form
- genesis_after_endwhile
- genesis_loop_else
- genesis_before_entry
- genesis_loop
- genesis_after_loop
- genesis_before_loop
- genesis_after_content
Sidebar.php
- genesis_before_sidebar_widget_area
- genesis_sidebar
- genesis_after_sidebar_widget_area
- genesis_before_sidebar_widget_area
- genesis_before_content
- genesis_after_content_sidebar_wrap
Sidebar-alt.php
- genesis_before_sidebar_alt_widget_area
- genesis_sidebar_alt
- genesis_after_sidebar_alt_widget_area
- genesis_before_sidebar_alt_widget_area
Footer.php
- genesis_before_footer
- genesis_footer
- genesis_after_footer
- genesis_after
That is every hook that Genesis loads in order on a typical front end page. As you see there are two different sets of loop hooks, the HTML5 and XHTML hooks. This is the single biggest change in the hook structure for Genesis and that is what you will need to focus on. In addition to those hooks, there are admin hooks and a few other hooks that are run in specific instances.
Admin
- genesis_cpt_archives_settings_metaboxes
- genesis_import_export_form
- genesis_export
- genesis_import
- genesis_admin_menu
- genesis_theme_settings_metaboxes
- genesis_admin_before_metaboxes
- genesis_admin_after_metaboxes
- genesis_admin_init
- genesis_settings_sanitizer_init
Upgrade.php
- genesis_upgrade
Menu
- genesis_register_nav_menus
Post
- genesis_reset_loops
Dynamic Hooks
Finally there are the dynamic hooks. These hooks are created by the functions that use them. This means they will change based on how they are used. For example, the “$args[‘before_sidebar_hook’]” hook below is created by the genesis_widget_area() function and it will use the widget area id to make a “genesis_before_sidebar_widget_area” hook when the primary sidebar is loaded.
- $this->pagehook . ‘_settings_page_form’
- $this->pagehook . ‘_settings_page_boxes’
- $args[‘before_sidebar_hook’]
- $args[‘after_sidebar_hook’]
As you can see, there are a LOT of hooks. By my count there are 78 total hooks plus the Dynamic hooks that create additional hooks as needed. Additionally WordPress has dozens of hooks so you can add content almost anywhere. With the addition of priorities (which I explain in the original Genesis Explained Actions article) you have near perfect control with these hooks. That is one reason why Genesis is so amazing and why we have been so excited for Genesis 2.0 to hit.
So what are you waiting for? Dive in.
Carrie Dils says
Thank you, thank you, thank you. I’ve been anticipating how development and theme customization will change with 2.0 and this is really helpful. Keep the good stuff coming. 🙂
Keith Davis says
A labour of love Nick.
Many thanks for sharing.
Hard Boiled Greg says
Thank you so much, Nick. I too am a little uncertain about what 2.0 brings, so this is extremely valuable.
Jeni says
Thanks for the guided tour, Nick. Can’t wait to see what new design options we have – I’m along for the ride!
Jonathan says
Great write-up Nick!
I’m really looking forward to using the new HTML5 elements in Genesis 2.0, it’s been a long time coming.
Seth says
Fanfreakingtastic! I Can’t wait for 2.0 to roll out. Game changer once again. Thanks for documenting all this, Nick!
Lynn says
What a great story from your childhood. Leaping off the high-dive and never looking back… great analogy for the 2.0 upgrade. Thanks for those few pleasant moments reading about life today.
nickthegeek says
thanks, I’ve been trying to implement a better “hook” at the start of my tutorials like they say you are supposed to do over at copyblogger. Glad to see it was noticed.
Natalie says
Thank you, thank you, thank you! I just started with Genesis and was at a complete loss until I found your tutorial series. Can’t wait to dig in to the new one.
Philip Gledhill says
Nick, until I read your Genesis Explained series I hadn’t a clue how the basics of Genesis code worked.
There are many excellent resources providing code snippets and tutorials for Genesis. But without understanding the basics, they’re of limited use. Thanks for teaching me (and a whole lot of other people) how Genesis works. It’s much appreciated.
I’m looking forward to your new tutorials.
Dee says
I’m stoked to be updating the webprincess site with 2.0 as we speak and glad to have your input with this new series to explain it as I go!! Thanks Nick!
nickthegeek says
Dee, I’m excited to see what you do with it. You have made some really cool sites.
Craig Grella says
I’ve been a long time thesis user, and still use the old and new versions, but I just started working with Genesis and really like it. Your tutorials here have been great. Thanks.
Carrie Dils says
Are the XHTML hooks there only as a fallback for themes not using HTML5? In other words, if I’m using HTML5 on a theme, stick with those hooks only?
Mahesh says
I have yet to check the Genesis Framework Beta 2.0. Just want to know if the improvements of the framework also require changes to the existing shortcodes hooks or not?
nickthegeek says
Short codes have remained the same. Most of the hooks remained the same. If you enable HTML5 the loop hooks changed though.
Velocity Pictures says
Independent movie suppliers are showing the fact that leading studios will no longer are the lone judges of what people prefer. If you happen to additionally distribution on the web, press websites, from rumor to entire videos. It’s a completely new planet. Much of it very good, some not.