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

Fix: Independent Publisher 2: Theme adds unwanted image cropping to RSS. #8613

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

Conversation

jorgefilipecosta
Copy link
Member

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 ); to set_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

  • Enable the Independent Publisher 2 theme.
  • Configure a site for podcasting
  • Publish a podcast post. Add a featured image that has equal width and height.
  • View the site's podcast feed and look for the itunes:image line for the post in the feed.
  • Verify the sizing parameters of the image still keep it square and not ?w=740&h=430&crop=1as in trunk.

@jorgefilipecosta jorgefilipecosta added the [Type] Bug Something isn't working label Jan 21, 2025
@jorgefilipecosta jorgefilipecosta self-assigned this Jan 21, 2025
Copy link
Contributor

Preview changes

I've detected changes to the following themes in this PR: Independent Publisher 2.
You can preview these changes by following the links below:

I will update this comment with the latest preview links as you push more changes to this PR.

Note

The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Independent Publisher 2: Theme adds unwanted image cropping to RSS feed
1 participant