Editor’s note: This week we have a friend and guest writer: Lori Berkowitz from Bee Dragon give us some insight as to why she thinks the Studio Press’ Genesis framework is the greatest thing since sliced bread. We reviewed Genesis from earlier this week from a content creator’s perspective, so here’s a coder’s perspective.
From a developer’s point of view, I have a huge crush on Genesis! I have become somewhat of a “Genevangelist”. The amount of time Genesis has saved me in the past year is incredible. I can build custom page templates in minutes and that is just the tip of the iceberg. I’ve been working with it for a little over a year now and have built quite a few sites using child themes, either completely custom or built from one of the child themes.
Genesis provides a lot of hooks, some filters, some shortcodes, and other handy developer friendly features, but my favorite function is genesis(); It allows you to make a page template by adding whatever hooks, functions, html, etc. that you want the page to have, followed by genesis(); The genesis() function will completely render the appropriate page type and follow whatever instructions you gave it in the rest of the file. For example, a page template for a custom post type could look like this:
php // Template Name: Template Name Here
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_loop');
function custom_loop() {
global $paged;
$args = array('post_type' => 'PostType'); // any wp_query args can go here
genesis_custom_loop( $args );
}
genesis();
If you are interested, I have been collecting Gensis snippets here.
The source link on some snippets leads to other sites with lots of useful Genesis info and tips.