Fix: Independent Publisher 2: Theme adds unwanted image cropping to RSS. #8613
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #2754
A sizing parameter is added to the image URL: ?w=740&h=430&crop=1 on the podcast feeds.
This causes the image in the feed to be cropped, and for distributors like Spotify and Apple Podcasts to use the cropped image instead.
This happens because we were setting a fixed post thumbal size, which made a crop happened to force the images to be in that size.
Changes proposed in this Pull Request:
These PR changes
set_post_thumbnail_size( 740, 430, true );
toset_post_thumbnail_size( 740, 9999, true );
making the post thumbnails/feature image still have a width of 740 but having a dynamic height proportional to the width avoid the crop.This makes the theme follow a similar pattern used on core themes e.g:
https://github.com/WordPress/wordpress-develop/blob/f2f13cbff083e2dd7973565bdb9523f10746085e/src/wp-content/themes/twentytwenty/functions.php#L63
https://github.com/WordPress/wordpress-develop/blob/f2f13cbff083e2dd7973565bdb9523f10746085e/src/wp-content/themes/twentynineteen/functions.php#L47
https://github.com/WordPress/wordpress-develop/blob/f2f13cbff083e2dd7973565bdb9523f10746085e/src/wp-content/themes/twentytwentyone/functions.php#L65
Testing
?w=740&h=430&crop=1
as in trunk.