post

Creating “Unbreakable” Genesis Child Themes for Clients

So, one of the things, I started doing was “protecting” my child themes by moving everything out of functions.php. I create a folder called lib or custom with a file called functions.php (contains various functions) and/or child-setup.php (contains things like registering custom post types, custom taxonomies, meta boxes, registering/unregistering layouts/sidebars, theme support, image sizes, and site-wide changes like the moving or removing of post meta/breadcrumbs, etc.).

Then in my functions.php file, I add a few require_once statements with important titles and a death warning not to remove any of these statements. So a theme functions.php may look like:

<?php
/********************************************************************************/
//DO NOT EDIT! EDITING THIS SECTION CAN HAVE SERIOUS RAMIFICATIONS!
// Start the engine
require_once(TEMPLATEPATH.'/lib/init.php');
//Start Child Theme engine
require_once(STYLESHEETPATH.'/lib/init.php');
//Custom Child Theme library
require_once(STYLESHEETPATH.'/custom/custom-footer.php');
require_once(STYLESHEETPATH.'/custom/child-setup.php');
require_once(STYLESHEETPATH.'/custom/functions.php');
/********************************************************************************/
//Add any extra functions, below here! Enjoy!

Are there any tricks that you use?

post

Post Formats in WordPress 3.1: Checking for Theme Support and Adding Theme Support

With WordPress 3.1, Post Formats were added, which makes WordPress a hybrid between its traditional CMS/blog environment and Tumblr’s quick posting format. This cross or hybrid makes WordPress much more powerful and flexible.

To check to see whether the current theme supports post formats use the following conditional to do nothing if the theme does not support post formats:

if ( !current_theme_supports( 'post-formats' ) || !function_exists( 'get_post_format' ) )
  return;

Or with Genesis:

if ( !current_theme_supports( 'post-formats' ) || !current_theme_supports( 'genesis-post-format-images' ) || !function_exists( 'get_post_format' ) )
  return;

To add theme support for post formats, you will need to add the following:

add_theme_support( 'post-formats', array( 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) );

For Genesis child themes, you’ll need to add an additional theme support which is used in the genesis function, genesis_do_post_format_image().

add_theme_support( 'genesis-post-format-images' );