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

Image sizing problem in feed #114

Closed
1 of 2 tasks
petrkucerak opened this issue Dec 6, 2024 · 1 comment · Fixed by #115
Closed
1 of 2 tasks

Image sizing problem in feed #114

petrkucerak opened this issue Dec 6, 2024 · 1 comment · Fixed by #115
Assignees
Labels
priority Priority or time-sensitive issue problem Problem that needs to be fixed

Comments

@petrkucerak
Copy link
Member

petrkucerak commented Dec 6, 2024

WordPress 6.7 added a new feature, that adds loading="lazy" for each image without checking if the height and width is set.
For image responsivity we remove size from image covers:

function removeImageAttr() {
$("img").removeAttr("width height");
}
.
It causes problems on Chromium-based browsers.

Dissucussions

Just show that Google chrome adds CSS from browser side. Checked in Version 130.0.6723.117 and 131.0.6778.70 version.

img:is([sizes="auto" i], [sizes^="auto," i]) {
   contain: size !important;
   contain-intrinsic-size: 300px 150px;
}

Do we still needs to add anything from our side?
If you are having problems with this, soon a new patch will be released.

Simply by adding

<?PHP
add_filter('wp_img_tag_add_auto_sizes', '__return_false');

It will solve the issue.

It's scheduled for next update 6.7.1

Tasks

  • Dockerize WP for local development
  • Solve the problem
@petrkucerak petrkucerak added problem Problem that needs to be fixed priority Priority or time-sensitive issue labels Dec 6, 2024
@petrkucerak petrkucerak self-assigned this Dec 6, 2024
@Vilican
Copy link
Member

Vilican commented Dec 6, 2024

@petrkucerak - Note: we can't edit template files. Any modifications need to be release as a separate plugin.

@petrkucerak petrkucerak linked a pull request Dec 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority Priority or time-sensitive issue problem Problem that needs to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants