Home page top rotating image size
Support Area › Forums › Agency › Home page top rotating image size
- This topic has 7 replies, 2 voices, and was last updated 9 years, 10 months ago by Bill Robbins.
-
AuthorPosts
-
June 30, 2014 at 10:20 #20465Durenda WoodParticipant
Hello,
I am working on replacing the rotating pictures at the top of the home page. I had it set to 1280 by 720 and when I replaced the first slide it changed the size to 1280 by 450. I changed the 450 to 720 in the images.php file but it did not change in on the website. The first image is way shorter than the rest of the sliders.
June 30, 2014 at 10:24 #20466Bill RobbinsModeratorGood Morning Durenda,
When you change any image sizes in WordPress (in a theme, plugin or in the Settings > Media screen) the changes will only affect future uploads. To change images that have already been uploaded, you’ll need to use the regenerate thumbnails plugin. It’ll add a new screen to your tools menu that you can use to change images that have already been uploaded.
Let me know if you run into trouble,
BillJune 30, 2014 at 10:42 #20467Durenda WoodParticipantThanks Bill for such a fast reply.
I just uploaded a new image and it changed it to 1280 by 800 and the image is actually set to 720. Can you explain that? Or will that plugin fix that too?
June 30, 2014 at 11:30 #20468Bill RobbinsModeratorWould I would try doing is dragging the image from the site to your desktop and then open it up in a photo editor to verify the dimensions of the actual image file. Depending on how everything is set, the image may be stretched to fill the width which could make it taller than expected. That’s typically what’s going on when an image ends up taller than expected in a slider.
June 30, 2014 at 11:39 #20469Durenda WoodParticipantI modified the image before I uploaded it in photoshop The actual size of the image is 1152 by 720.
This is the code for images.php
$post->ID, ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order ID’) );
$results = array();
if ($photos) {
foreach ($photos as $photo) {
// get the correct image html for the selected size
$results[] = wp_get_attachment_image($photo->ID, $size);
}
}return $results;
}// Adds reminder of image sizes
function organizedthemes_display_sizes( $translated ) {global $post;
if ( get_post_type($post) == ‘post’ ) {
$translated = str_ireplace( ‘Featured Image’, ‘Featured image (1280w x 720h)’, $translated );
}if ( get_post_type($post) == ‘page’ ) {
$translated = str_ireplace( ‘Featured Image’, ‘Featured image (1280w x 720h)’, $translated );
}if ( get_post_type($post) == ‘slide’ ) {
$translated = str_ireplace( ‘Featured Image’, ‘Featured image (1280w x 720h)’, $translated );
}if ( get_post_type($post) == ‘staff’ ) {
$translated = str_ireplace( ‘Featured Image’, ‘Featured image (370w x 370h)’, $translated );
}return $translated;
}
add_filter( ‘gettext’, ‘organizedthemes_display_sizes’ );
add_filter( ‘ngettext’, ‘organizedthemes_display_sizes’ );June 30, 2014 at 11:46 #20470Bill RobbinsModeratorThat’s what is then. The image’s width (1152) is smaller than the image size’s width (1280). The browser will stretch the image to fill the full width of 1280 pixels which will cause the image in your browser to grow in height. If you’ll resize your image in Photoshop so that it’s 1280 pixels wide that should keep the browser from stretching it and thus making it taller.
June 30, 2014 at 14:45 #20476Durenda WoodParticipantI made all of the images the exact same size and it worked perfectly, Thank you for your help!
June 30, 2014 at 15:00 #20478Bill RobbinsModeratorAnytime Durenda. Have a great week 🙂
-
AuthorPosts
- The topic ‘Home page top rotating image size’ is closed to new replies.