Code Monkey home page Code Monkey logo

Comments (3)

joemcgill avatar joemcgill commented on June 13, 2024

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.

timrourke avatar timrourke commented on June 13, 2024

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.

joemcgill avatar joemcgill commented on June 13, 2024

Totally agree. Sorry for the confusion.

from wp-tevko-responsive-images.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.