Source View: twentyeleven_header_image_height

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
114      // The default header text color
115      define( 'HEADER_TEXTCOLOR', '000' );
117      // By leaving empty, we allow for random image rotation.
118      define( 'HEADER_IMAGE', '' );
120      // The height and width of your custom header.
121      // Add a filter to twentyeleven_header_image_width and twentyeleven_header_image_height to change these values.
122      define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) );
123      define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 288 ) );
125      // We'll be using post thumbnails for custom header images on posts and pages.
126      // We want them to be the size of the header image that we just defined
127      // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
128      set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
130      // Add Twenty Eleven's custom image sizes
131      add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Used for large feature (header) images
132      add_image_size( 'small-feature', 500, 300 ); // Used for featured posts if a large-feature doesn't exist