Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_theme_support( 'custom-header', $custom_header_support );
- if ( ! function_exists( 'get_custom_header' ) ) {
- // This is all for compatibility with versions of WordPress prior to 3.4.
- define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] );
- define( 'HEADER_IMAGE', '' );
- define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
- define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
- add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] );
- add_custom_background();
- }
- // We'll be using post thumbnails for custom header images on posts and pages.
- // We want them to be the size of the header image that we just defined
- // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
- set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
- // Add Twenty Eleven's custom image sizes.
- // Used for large feature (header) images.
- add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true );
- // Used for featured posts if a large-feature doesn't exist.
- add_image_size( 'small-feature', 500, 300 );
- // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
- register_default_headers( array(
- 'wheel' => array(
- 'url' => '%s/images/headers/wheel.jpg',
- 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Wheel', 'twentyeleven' )
- ),
- 'shore' => array(
- 'url' => '%s/images/headers/shore.jpg',
- 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Shore', 'twentyeleven' )
- ),
- 'trolley' => array(
- 'url' => '%s/images/headers/trolley.jpg',
- 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Trolley', 'twentyeleven' )
- ),
- 'pine-cone' => array(
- 'url' => '%s/images/headers/pine-cone.jpg',
- 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Pine Cone', 'twentyeleven' )
- ),
- 'chessboard' => array(
- 'url' => '%s/images/headers/chessboard.jpg',
- 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Chessboard', 'twentyeleven' )
- ),
- 'lanterns' => array(
- 'url' => '%s/images/headers/lanterns.jpg',
- 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Lanterns', 'twentyeleven' )
- ),
- 'willow' => array(
- 'url' => '%s/images/headers/willow.jpg',
- 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Willow', 'twentyeleven' )
- ),
- 'hanoi' => array(
- 'url' => '%s/images/headers/hanoi.jpg',
- 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg',
- /* translators: header image description */
- 'description' => __( 'Hanoi Plant', 'twentyeleven' )
- )
- ) );
- }
- endif; // twentyeleven_setup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement