Try this:
<?php //Custom header
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
if ( is_singular() &&
has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' )) &&
$image[1] >= HEADER_IMAGE_WIDTH ) :
// We have a new header image!
echo get_the_post_thumbnail( $post->ID, 'post-thumbnail', array('usemap' => '#Map') );
elseif ( $img_src = get_header_image () ) : ?>
<img src="https://wordpress.stackexchange.com/questions/33814/<?php header_image(); ?>" alt="<?php bloginfo('name'); ?>" usemap="#Map" />
<?php else: ?>
<h1><?php bloginfo('name'); ?></h1>
<?php endif; ?>
Related Posts:
- Why doesn’t WP_Image_Editor save images using the Filesystem API?
- Is there a plugin to make attaching images easier?
- Managing Images for a WordPress Blog: Picasa or Flickr?
- Automatically wrap post image in div
- How to rotate the header image per day?
- Custom image size not selectable in uploader
- where can i add custom script to stop header video from autoplay
- Retrieving and Storing Images Linked from Other Domains on Local Server?
- Customizer image control default value showing in customizer but not on frontend
- Importing media medium setting image gallery / image attachments
- Extract & Display the REAL first image attached to a post – extend the_post_thumbnail()
- Add filename to attachment page url
- How To Add buttons to the toolbar which appears in TinyMce when you click over images
- Image Editor does not affect custom sizes!
- custom headers for static home page and posts page
- How to display post title & excerpt when mouse hovers on an image?
- Automatically add image caption with values from a post parent field?
- Is there a way to dynamically get to your uploads folder?
- Using Fullscreenr with a wordpress blog – weird bug
- Get Image from Media Library with the Title
- Get Custom Logo Alt Text
- Resizing of a header/div in a website through css in wordpress [closed]
- Using custom image resizing script in a page
- Background image not appearing
- Best way to allow overwriting images shipped with the plugin?
- How to add css option to Header Image customizer?
- NextGEN Gallery – open all images on page in fancybox [closed]
- Featured Image If Else Condition
- Clickable image link sends people to wrong URL
- Use custom header as WordPress header
- How do I modify the size of the text in my page titles?
- How can style text like this in wordpress
- Is there a possiblity to replace profile image gravatar with custom user images
- Separate header for static home page and posts page
- Custom theme – how to link the image without posting it
- Trying to set specific image dimensions and crop with ACF
- Customizing the gallery of the post correctly
- Personalized Gallery what are my options?
- We are facing this error in header unable to understand the issue
- adding fade on mouseover to images
- Lightbox not showing image caption
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- POST 429 Error when trying to place more than 20 images into post at once
- Duplicate Header and Footer
- How to add the option to choose between sizes for featured image within post editor?
- How to add a static text at end of a wordpress permalink
- Creating custom setting in add media popup
- Translate site in own text-language [closed]
- Upload image without resizing but insert in post with resizing
- Bio comes up when the visitor clicks on a picture
- Adding images to anchors in the list created and fetched with wp_nav_menu
- Move text from the side of image to below image [closed]
- How do i edit text that is not in the customization menu
- How do I enable the text editer in my WordPress theme? [closed]
- WordPress Install – “end of script output before headers” when running simple php script
- Show Header When Not In Iframe
- Change default “Apply Changes To” radio option when editing images
- Create a google friendly header with text and logo
- WP_Customize_Image_Control and selecting from library?
- featured images – custom links
- Get a different size of Image thumbnail while working with custom metabox
- Custom image sizes ignored in WP 3.5
- Edit image alignment in WordPress twentysixteen child theme on attachment page [closed]
- Set custom banner image size with wp_customize
- How to search for replacement titles and contents, excluding image URLs
- Custom Search on media files PDF images pages posts
- WordPress objects class reference
- How do you add pages on a staging server, and then move them over to production
- Any Hook Called When Post Becomes Published?
- Theme Twenty Fifteen: Customize Color Scheme Customizer
- Is it possible to set default values for custom fields in a custom post type while my plugin is being activated?
- WordPress Template not affecting the working, keeps defaulting to the index.php template
- Reinstall WordPress Without Losing Data
- WP Northwind for Theme Development?
- How to check if site is created by wordpress? [duplicate]
- Enabling Additional CSS / custom-css
- Add google org chart to wordpress page
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- The function can not create a table on MariaDB server
- Set Title from Custom Template
- For a specific theme, how do I build a list of all the possible theme modification names?
- Switch between WordPress websites easy for an end user
- How to print Array values of custom Fields Meta?
- Customizer JS API get value of customizer field
- Hide content and functions from specific user roles
- Translating (WooCommerce) placeholder text
- Get All Results From Other Users That Share The Same Custom User Meta As Current User
- How to remove (…) from the post tilte on homepage?
- How can I setup a development environment which auto refresh page when code have changed [closed]
- I want to use a product thumbnail completely different than the product image
- How can I edit the WordPress menu link to allow fb: instead of http
- Fixed bottom menu on mobile doesn’t work on search included in Child Theme of Storefront
- Change Dashboard menu position?
- Get site ID from attachment url?
- duplicate featured image functionality in custom meta box
- How to automatically pull an information from a form field onto an other page?
- How to create a custom menu for specific user
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Customize TinyMCE Buttons
- Instead of Custom CSS Theme CSS is loading