New Loop Hooks in Genesis 2.0

If you haven’t heard, Genesis 2.0 is coming soon (you can run Genesis beta by using this plugin). And with it comes the ability to make your site output HTML5 markup and Schema.org microdata, which put a new emphasis on semantics in the way we mark up out content.

With this in mind, it became clear to us that our old loop hooks just didn’t pass the smell test. “post” simply does not accurately describe the types of content you can manage with WordPress. For instance, pages. Or worse, the infinite possible content types you can create and manage with Custom Post Types.

Using the genesis_before_post_content hook to insert something before the page content makes very little sense.

So we decided to update the Genesis loop function to reference the “entry” instead. We also updated our tag classes to follow this same pattern: entry, entry-header, entry-title, entry-meta, entry-content, entry-footer … you get the idea.

Note: if you’re using Genesis without HTML5 activated, all the old hooks and markup work as before. Genesis 2.0 is 100% backward compatible.

If HTML5 is not active, it uses the legacy loop (with all the old hooks and markup).

So, if you want to insert something after a post, page, or custom post type, you need to use the genesis_after_entry hook.

Pretty simple.

But the same goes for the things that you would want to unhook.

If you want to remove something from executing, you need to remove it from the new hook, rather than the old one. Here’s a list of the default entry element actions:

	add_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
	add_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
	add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
	add_action( 'genesis_entry_header', 'genesis_do_post_title' );
	add_action( 'genesis_entry_header', 'genesis_post_info', 12 );

	add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
	add_action( 'genesis_entry_content', 'genesis_do_post_content' );
	add_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
	add_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );

	add_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
	add_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
	add_action( 'genesis_entry_footer', 'genesis_post_meta' );

	add_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
	add_action( 'genesis_after_entry', 'genesis_adjacent_entry_nav' );
	add_action( 'genesis_after_entry', 'genesis_get_comments_template' );

So there you go! New semantic HTML5 hooks in Genesis 2.0. Enjoy!

Absentee Blogger

I won’t deny it. I’m embarrassed to see that my last blog post was published in 2009. Let’s catch up.

Not a bad way to spend one’s time.

So yeah, I’m back, and I will be writing again. I’ve learned an incredible amount of new stuff over the last few years, and it’s time I start publishing all those goodies. Expect the usual, but with a Genesis twist. I did build the theme, after all.

If you notice that the comment form looks a bit off, you’re not crazy. It probably is. I just haven’t gotten around to fixing it.

Join the Public Developer Beta for the Prodigy Theme

For the last several months, I’ve been quietly developing a theme framework for iThemes — a framework we could use to offer solid code, killer designs, and futureproofing (one of our most common requests at iThemes).

A couple of weeks ago, I invited a few people to join a private beta of the theme (called Prodigy, in case you hadn’t gathered), and it has been silky smooth. Hardly any complaints or bugs, and TONS of compliments. So, I think the theme is ready for a public beta, and you’re all invited!!! Read More

Final Word on WordPress Themes and the GPL?

Matt Mullenweg, the founder and lead developer of the WordPress blogging platform, emailed the Software Freedom Center recently asking about the legality of WordPress themes being licensed under copyright not compatible with the GPL, and they’ve now responded, which Matt has published on the WordPress Development Blog.

The conclusion? The PHP files in WordPress themes must inherit the GPL, but CSS and Images do not. From the email:
Read More

What Do You Want to Know About WordPress?

Over the next few weeks, I want to take reader-submitted questions about WordPress and answer them here on the blog. Have a question about themes? Plugins? Simple or complicated — it doesn’t matter!

If I pick your question, I’ll answer it (in as much detail as necessary) here on the blog, and link to you as the source of the question.

Hopefully this will be a BIG help to everyone out there, and make for some really good conversation! Leave your questions in the comments.