Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Slider Mobile 750x400 Size Addition #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasperf
Copy link
Contributor

@jasperf jasperf commented Dec 21, 2024

Images like https://autentical.nl/wp-content/uploads/sites/42/2017/08/el-rocio-1-750x400.jpg fail loading on homepage slider mobile for autentical.nl and other slider images with same format on mobile are no longer available. This is also the case on other locations like on the autentical.es homepage.

Not clear why they have gone missing and why there was no such add_image_size option (anymore). Likely cause is removal or change of the add_image_size for that format. This could also be the cause for why so many images are missing. Only not clear why the older images with that format were removed after changes were made.

This pull request includes a minor addition to the functions.php file. The change introduces a new custom image size for mobile slider images, which was previously missing from the site as size and for which images are missing on server. New size will have to be generated on the server with wp-cli See instructions that will follow.

Theme Enhancements:

  • functions.php: Added a custom image size base_hotel_img_mobile with dimensions 750x400px for mobile slider images.

Current Image Sizes

wp media image-size
+-------------------------------------+-------+--------+------+-------+
| name                                | width | height | crop | ratio |
+-------------------------------------+-------+--------+------+-------+
| full                                |       |        | N/A  | N/A   |
| 2048x2048                           | 2048  | 2048   | soft | N/A   |
| base_hotel_img_slideshow_home_large | 2000  | 1100   | hard | 20:11 |
| base_hotel_img_slideshow_home       | 1800  | 800    | hard | 9:4   |
| 1536x1536                           | 1536  | 1536   | soft | N/A   |
| base_hotel_img_slideshow_large      | 1200  | 600    | hard | 2:1   |
| base_hotel_img_special_banner       | 1200  | 400    | hard | 3:1   |
| base_hotel_img_gallery              | 900   | 900    | soft | N/A   |
| base_hotel_img_slideshow            | 770   | 500    | hard | 77:50 |
| medium_large                        | 768   | 0      | soft | N/A   |
| base_hotel_img_special_sidebar      | 380   | 250    | hard | 38:25 |
| base_hotel_img_room_thumb           | 380   | 380    | hard | 1:1   |
+-------------------------------------+-------+--------+------+-------+

Verify new size is registered

to verify newly added size after child theme update with newly added image size use:

wp media image-size

Regenerate thumbnails for newly added image size

wp media regenerate --only-missing --image_size=base_hotel_img_mobile --yes

Verification

ls -l /var/www/autentical.com/public_html/wp-content/uploads/sites/42/2017/08/el-rocio-1-750x400.jpg

@jasperf jasperf changed the title Missing Slider Mobile 750x40 Size Addition Missing Slider Mobile 750x400 Size Addition Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant