Featured Image Size Not Consistent
-
Hey, so for my featured image, the images I use for each page differ in size initially. I tried to set it so that the image would be fit to the same size no matter what the initial size was, however, this is not working for me as the images still have different sizes.
For example, look at these two pages:
https://www.thelostgeographer.net/australia/
https://www.thelostgeographer.net/bolivia/The featured images (the flags of the countries) do not take up the same space on their respective pages.
Here is the code I have so far:
1. (In the header)
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail(‘banner’);
}
?>2. (In style.css)
/*Image Style*/
img {
max-width: 100%;
}3. (In functions.php)
add_theme_support( ‘post-thumbnails’ );
add_image_size( ‘banner’, device-width, 1280, true);Thanks in advance for any help!
- The topic ‘Featured Image Size Not Consistent’ is closed to new replies.