Advertisement
grappler

functions.php

Aug 24th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.35 KB | None | 0 0
  1. add_theme_support( 'custom-header', $custom_header_support );
  2.  
  3.     if ( ! function_exists( 'get_custom_header' ) ) {
  4.         // This is all for compatibility with versions of WordPress prior to 3.4.
  5.         define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] );
  6.         define( 'HEADER_IMAGE', '' );
  7.         define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
  8.         define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
  9.         add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] );
  10.         add_custom_background();
  11.     }
  12.  
  13.     // We'll be using post thumbnails for custom header images on posts and pages.
  14.     // We want them to be the size of the header image that we just defined
  15.     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
  16.     set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
  17.  
  18.     // Add Twenty Eleven's custom image sizes.
  19.     // Used for large feature (header) images.
  20.     add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true );
  21.     // Used for featured posts if a large-feature doesn't exist.
  22.     add_image_size( 'small-feature', 500, 300 );
  23.  
  24.     // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
  25.     register_default_headers( array(
  26.         'wheel' => array(
  27.             'url' => '%s/images/headers/wheel.jpg',
  28.             'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
  29.             /* translators: header image description */
  30.             'description' => __( 'Wheel', 'twentyeleven' )
  31.         ),
  32.         'shore' => array(
  33.             'url' => '%s/images/headers/shore.jpg',
  34.             'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
  35.             /* translators: header image description */
  36.             'description' => __( 'Shore', 'twentyeleven' )
  37.         ),
  38.         'trolley' => array(
  39.             'url' => '%s/images/headers/trolley.jpg',
  40.             'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
  41.             /* translators: header image description */
  42.             'description' => __( 'Trolley', 'twentyeleven' )
  43.         ),
  44.         'pine-cone' => array(
  45.             'url' => '%s/images/headers/pine-cone.jpg',
  46.             'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg',
  47.             /* translators: header image description */
  48.             'description' => __( 'Pine Cone', 'twentyeleven' )
  49.         ),
  50.         'chessboard' => array(
  51.             'url' => '%s/images/headers/chessboard.jpg',
  52.             'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg',
  53.             /* translators: header image description */
  54.             'description' => __( 'Chessboard', 'twentyeleven' )
  55.         ),
  56.         'lanterns' => array(
  57.             'url' => '%s/images/headers/lanterns.jpg',
  58.             'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg',
  59.             /* translators: header image description */
  60.             'description' => __( 'Lanterns', 'twentyeleven' )
  61.         ),
  62.         'willow' => array(
  63.             'url' => '%s/images/headers/willow.jpg',
  64.             'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg',
  65.             /* translators: header image description */
  66.             'description' => __( 'Willow', 'twentyeleven' )
  67.         ),
  68.         'hanoi' => array(
  69.             'url' => '%s/images/headers/hanoi.jpg',
  70.             'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg',
  71.             /* translators: header image description */
  72.             'description' => __( 'Hanoi Plant', 'twentyeleven' )
  73.         )
  74.     ) );
  75. }
  76. endif; // twentyeleven_setup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement