On the else if there is missing a closing bracket: } elseif ( is_page(1) ) {.
Since all you alter is the file name, it’s sufficient to use the following code:
if ( is_home() ) $my_header_image = get_header_image();
elseif ( is_page(1) ) $my_header_image = "http://.../ImageB.png";
elseif ( is_... ) $my_header_image = ...;
else...
?>
<img src="https://wordpress.stackexchange.com/questions/89451/<?php echo $my_header_image; ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
Related Posts:
- Automatically generate multiple image sizes for element
- Change the output for [gallery] shortcode
- “There has been an error cropping your image” when cropping image
- How to set twenty fourteen header image at 100% width?
- How to add php to theme to show alt attributes
- How to Display an Image Uploaded through a Meta Box in a Template?
- How to remove header images from all pages except the home page? skeleton theme
- How to place an image into header.php? [closed]
- Different custom header image on different page
- Why is wordpress searching for @2x images?
- Loss of sharpness in jpg imported as header in twentyeleven
- Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- How can I use cached images in an AJAX response?
- WordPress 4.1 header image problem
- Resize header image
- How do I get my main image to stretch the full length of the screen?
- How to remove header images from displaying (not css or editing)?
- HowTo: develop WP template with dynamic background image
- Multiple post image, echo url (path of image)
- I want to rel=nofollow wordpress images
- Logo is not being displayed in header (Twentytwelve)
- Apply nextgen-gallery lightbox effect [closed]
- Placing a featured image into header
- How to create a title images for different posts?
- trouble calling different header.php for home.php
- How to add cropped custom header image?
- How to get rid of undefined variable in previous post image
- Featured image not shown in header
- Responsive header image
- How can I change the header on the pages?
- How to echo images Urls from a wordpress post, that are relally in the post
- Change header image size
- How to add php to theme to show alt attributes
- Adding custom html/css/images to Theme
- second featured post not displaying on page [closed]
- How to add an image below the header on homepage
- Put image onto header
- Show uploaded images in full size
- Add custom version to an image
- Changing logo image in header.php upon language detection
- How to get customable image header?
- How to get dimension of Logo and Crest
- WordPress Site Broken and it gives Headers Already sent error
- Changing Theme produced a problem on some pages
- Issues with fixing wordpress site’s formatting with images
- Replacing an Image gallery
- Different image heights for different resolutions without distortion
- How do you cite the images on your blog? [closed]
- The most of the images don’t appear, although URLs are correct
- Images not showing after moving site
- Get the name of an image [duplicate]
- How do I display image files as links?
- Get an array containing ONLY post IDs of attached images
- Make all images displayed in single.php a certain size
- add_image_size() width not actually working
- Exporting a portfolio with pictures
- Adding Image Description below Images Inserted into Posts
- attachment.php & flexslider—linking thumbnail to specific image
- Plain image uploading – no links, no classes, no sizes
- Thumbnail gallery by date and taxonomy
- How to replace all images within exported xml files to demo.jpg?
- Create a custom attachment thumbnail for quick page load
- Change the image for a certain URL
- Surround uploaded image link with div
- Check if post has image
- Adding multiple images on my site – without using plugins [closed]
- How to watermark wordpress images from wp-content/uploads folder with htaccess and php?
- page displaying media caption shortcodes
- How to make an image bigger with wp_get_image_editor
- How to get children/attachments in header?
- Remove the height limit on wordpress 3.4.2
- Display different Images depending on the current day
- Uploaded Images not re-sized to ( Thumbnail, Medium, and Large ) size
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Extract url from next_image_link
- Custom styling Insert Media window
- How do I embed youtube video via url in frontend posting
- Assign one featured image to multiple posts?
- Some images don’t get linked when setting link-to to media-image
- Missing Images in Uploads Directory (Server Only)
- Only User Upload image Http Error
- Setting name of attachment URL
- Why are my ‘medium’ images the wrong size
- How can I hide previous_image_link() on first attachment page?
- Getting featured image of blog page rather than post image
- Lots of attachments is causing slow load
- Thumb doubles the image file size
- Image editor not working correctly
- Search and replace image urls in posts
- wp_get_attachment_image_src
- Cannot use existing image as a featured image since 3.8.1 update
- Images with excerpt function
- I am trying to get metabox image with custom size
- How do I get resized thumbnails?
- Removing image dimensions from `the_content`
- Protocol relative url not pulling up images on IE, FF, and OPERA
- How do I embed an image at actual size?
- Why WordPress doesn’t show pictures when I upload them in a new post?