How to Allow a Custom Size for a WordPress Custom Header Function
Twenty Eleven, the default theme included with WordPress, uses a large portion of the screen to display the top image or "header" of a page. The default header image size is 1000 by 288 pixels. However, you might like to use a smaller image size to devote more of your website's layout to text. Edit your website's functions.php file to define a new size for custom header images.
Instructions
-
-
1
Click to expand the "Appearance" heading on the left side of your website's main menu. Click the "Editor" link below.
-
2
Click the "Theme Functions" link on the right side of the page to edit your website's "functions.php" file. The source code for the file appears in the middle of the window.
-
-
3
Press "Ctrl" and "F" simultaneously to display your browser's "Find" dialog. Type "header_image" in the dialog to locate the following block of code:
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 288 ) ); -
4
Change the numbers "1000" and "288" to define a new width and height in pixels for custom header images.
-
5
Click the "Update File" button at the bottom of the screen to begin using the new size for header images on your website.
-
1
Tips & Warnings
When you define a new custom header size in your website's "functions.php" file, it affects only the images that you upload in the future. Your website continues to display previously uploaded images in their original size. Install the Regenerate Thumbnails plugin to automatically recreate your website's existing thumbnails using the new size you entered.