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
- get attachment title based on attachment id
- Get Image Description
- PHP Fatal error: Call to undefined function download_url()
- How to get Images included in Post
- Strange img srcset behaviour
- Images uploading to wrong folder
- set_post_thumbnail_size not cropping featured images, but reducing proportionally
- Why does wordpress generate more thumbnails than the 3 standard sizes?
- Pulling Post Image Attachments in WordPress 3.9
- Link Featured Thumb to Attachment Page, If Possible
- Different captions for the same image in multiple galleries. Edit Image in Gallery locally
- Is there a shortcut to change bulk BMP images to JPG images in a site?
- WordPress Post featured image URL in the header
- How do I get more image editing options in the admin?
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- How to display / include a specific jpg on a page
- Grab remote images and update links in existing posts
- Store Snapshot created via wordpress to use with lightbox
- Get image URL after image created from canvas and sent to WP uploads with AJAX
- Can’t get images to align with Gutenberg editor
- Custom Loop, Match Category with Page: How to display post featured image?
- Modifying the HTML Output of Inserted Images
- Google verification challenge with file location
- How to check for images before echo
- Remove height attribute from wp_get_attachment
- How do I retrieve an image’s width and height using Advanced Custom Fields?
- wp get attachment image always gives me thumbnail
- Two “the_excerpt” questions
- Images are not showing after moving WordPress installation from server to localhost?
- Images are not showing up in “Uploaded to this post”
- Cache DB queries result
- Remove “%” from strings in serialized arrays in wp_postmeta
- Images not found after migrating WordPress website
- Adding srcset to an image in ajax
- Error uploading images in wordpress
- Disable Media File Image Link On Mobile Devices
- Set two default featured images
- Automatically generate missing images
- VT-resize (great alternative to timthumb) : Errors cropping (litespeed, centos 6.3)
- Page speed error: “serve scaled images”
- Image Captions Have a 10px Extra Margin, And It’s Not CSS? [duplicate]
- Load url image full size in thumbnail, medium, large size
- WordPress can’t detect any thumbnails size?
- Remove image border in twentyeleven theme [closed]
- 403 Forbidden when accessing image in wordpress
- For what does WP generate Thumbnails?
- Images are not shown
- Remove the height limit on wordpress 3.4.2
- Image media upload problem in page editing modus?
- Is there a good way to use CMS images with CSS
- Upload image from other server without resize?
- where is images/image.jpg?
- Using the on-board image editor for featured images: edits are not being used
- change with CSS the color of an svg background image set with “background-image: url()”
- What type to upload image within theme options?
- Images have dissapeared from media library and site