Add theme support option for turning on random default headers. fixes #17832

git-svn-id: https://develop.svn.wordpress.org/trunk@18325 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-06-22 19:09:23 +00:00
parent 80640b5e25
commit b1e314fbf7
2 changed files with 22 additions and 7 deletions

View File

@@ -109,12 +109,12 @@ function twentyeleven_setup() {
// This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
add_theme_support( 'post-thumbnails' );
// The next four constants set how twentyeleven supports custom headers
// The next four constants set how Twenty Eleven supports custom headers.
// The default header text color
define( 'HEADER_TEXTCOLOR', '000' );
// By leaving empty, we default to random image rotation
// By leaving empty, we allow for random image rotation.
define( 'HEADER_IMAGE', '' );
// The height and width of your custom header.
@@ -131,6 +131,9 @@ function twentyeleven_setup() {
add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Used for large feature (header) images
add_image_size( 'small-feature', 500, 300 ); // Used for featured posts if a large-feature doesn't exist
// Turn on random header image rotation by default.
add_theme_support( 'custom-header', array( 'random-default' => true ) );
// Add a way for the custom header to be styled in the admin panel that controls
// custom headers. See twentyeleven_admin_header_style(), below.
add_custom_image_header( 'twentyeleven_header_style', 'twentyeleven_admin_header_style', 'twentyeleven_admin_header_image' );