large shade tree

Navigation

Information

Recent Posts

Shade Tree Sites |Building Better Websites

Updating A Theme for WordPress 3.0

Recently was going back through some older themes (including this one) and updating to take advantage of the new features in WordPress 3.0 – had to search around a little to find the appropriate code snippets to include figured I’d go ahead and list them out here in case anyone else was interested in doing the same thing.

Note:  You don’t have to update for a theme to work – all my older themes are working just fine without the updates – but if you would like to take advantage of some or all of the new features in your theme it’s really easy to do – just pick and choose what works for you.

Additional Note:  You will need to add <? and > at the begining and end of the snippet.

 

Navigation Menu Editor 
Add to functions.php:

  • add_theme_support( ‘menus’ );

Then add  to header.php:

  • ‘menu_order’, ‘container_class’ => ‘menu-header’ ) );

Note: menu-order is the css class for the menu – style accordingly in style.css

Custom Header Management
Add to functions.php:

define( ‘HEADER_IMAGE’, ‘%s/images/logo.png’ ); // logo located in your theme folder
define( ‘HEADER_IMAGE_WIDTH’, apply_filters( ”, 770 ) ); // Width
define( ‘HEADER_IMAGE_HEIGHT’, apply_filters( ”, 153 ) ); // Height
define( ‘NO_HEADER_TEXT’, true );
add_custom_image_header( ”, ‘admin_header_style’ ); // Enables the Appearance > Header
// For Styling the Admin Side
if ( ! function_exists( ‘admin_header_style’ ) ) :
function admin_header_style() {
?>

}
endif;

Add php header_image(); in header.php

Automatic Header ImageFeed Links
Add to functions.php.

  • add_theme_support( ‘automatic-feed-links’ );

Add Support For Post Thumbnail Images
Add to functions.php:

  • add_theme_support( ‘post-thumbnails’ );

Add: php the_post_thumbnail(); to template to call the featured image.

Custom Backgrounds
Add to functions.php

  • add_custom_background();