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
- get the attachement url for the medium sized image
- Each custom image size in custom upload directory?
- How to automatically add rounded corners to thumbnails?
- Is there a simple way to just insert a link to an image (without inserting an image)?
- Watermarking Images with WordPress with WP_Image_Editor
- Get attachment/image info in JS
- Auto-modifying original [full size] images
- How to limit number of images being printer out in “Set Featured Image” pop up?
- Black and White thumbnails
- Crop image to horizontal or vertical by code based on image size
- Pasting images removes class attribute
- How can I make all gallery images to open in a new window?
- Open the attachment details modal
- Crop image without scaling or resizing with add_image_size()
- Download button for Featured Image in every post – automatically
- Responsive background images added inline
- How to make programmatic image upload generate thumbnail and sizes?
- Editing built in Gallery shortcode to filter by categories
- Image with description side by side
- How to remove buttons from gutenberg toolbar
- Random popup image per user with no repeat
- Speed of the slider images should be increased in wordpress
- Modifying protexted image sizes: use “add_image_size()” or “update_option()”?
- Get full image array
- attach unattached featured images to respective posts
- Display number of images actually posted
- Confusion about arguments sent to add_image_size
- Is it possible to pull and display a single landscape oriented image
- Remove image classes from post thumbnail output
- change the $content_width
- Different image sizes for home and post pages
- Show full image thumbnail
- upload featured image in custom post type from frontend
- Make medium_large images available to insert into post
- Removing height and width from images with a caption
- Creating a thumbnail from an image already on the server?
- Images not showing on blog
- Alter the image, before save, of a particular image size
- Why does Google Image Search still display my images?
- Responsive Header for Phone
- Dynamic tagged image galleries
- Image auto resize
- WP fails to upload files to media library, /wp-admin/async-upload.php 403 forbidden
- Add a background image for Custom Post Type archives page
- Empty alt/title form check in media library
- Images stopped loadding after adding SSl
- Background-image not showing? [closed]
- How To Get The File Extension Of Images Having Different Extensions In A Directory?
- GoDaddy Number of Image Files Per Directory Exceeded
- Post and featured image have the same name, why is the attachment (image) is showing and not the post?
- Scaling an image in a WordPress post
- My subdirectory sites images (except webP) are throwing to 404 page even they are exist
- changing option for all posts
- Disable image compression for WebP
- Image editing no longer works after moving to a new server