Comments (3)
Hey Tim,
Glad the plugin is helping you simplify your workflow. The behavior that you're seeing is exactly what is expected, but it's not at all clear in the documentation. The second (i.e. size) parameter passed to the function—in your case 'medium'—is used to determine the aspect ratio of the image, which is compared with all available sizes available in the meta attachment field of the associated image so the browser can choose whichever image size is most appropriate.
If you know the actual layout size of the image in your theme, you should also add an additional sizes
property to your image tag which lets the browser know how wide the image is at each breakpoint in your theme. If you're running the latest master branch of this plugin from the GitHub repo, you can take advantage of a new function, tevkori_get_sizes_string()
to output a default size attribute for the $id
and $size
that you pass to the function.
Hope that helps.
from wp-tevko-responsive-images.
Thanks, that really clears things up! Using lazysizes in conjunction with wp-tevko-responsive-images/Picturefill seems to solve the 'sizes' issue much more efficiently, removing the need for an explicit declaration of a maximum reasonable size.
I would say the docs could definitely be better for this plugin, at least for folks like me who couldn't read PHP to save their lives. :-)
from wp-tevko-responsive-images.
Totally agree. Sorry for the confusion.
from wp-tevko-responsive-images.
Related Issues (20)
- `the_post_thumbnail()` not returning `srcset` attributes. HOT 2
- Function to output responsive images in themes HOT 1
- Should we increase the default of 'max_srcset_image_width'? HOT 1
- Update documentation of 'wp_get_attachment_image_sizes()'
- Incorrect inline documentation HOT 2
- Problem with filter deprecation notices HOT 1
- Test test_tevkori_filter_content_images() failing against WP nightlies HOT 2
- Full URL path to files HOT 1
- Add custom srcset + sizes values to post thumbnails? HOT 1
- Incorrect srcset for retina images in 3.1.0 HOT 1
- Image tags without ending slash are never made responsive. HOT 4
- wp_calculate_image_srcset(): Reduce accepted aspect ratio difference HOT 2
- Default theme image options can make test fail HOT 2
- Responsive images broken on edited/imported content HOT 1
- Update documentation about plugin features HOT 2
- Problem with WooCommerce images HOT 4
- Use custom sizes attribute with the_post_thumbnail HOT 5
- Backport WP 4.4.1 fixes. HOT 1
- Deprecate/remove calls to `_wp_upload_dir_baseurl()`
- Plugin compatibility with PHP 8.0 | Imagick 3.5.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-tevko-responsive-images.