Hammy speeds up your website by generating and serving resized images for your content area depending on content width.
Hammy takes your regular content images (only within posts and pages, not custom post types) and regenerates a number of smaller sized images. When a person visits your website, it then automatically provides them with the most appropriate image (or the smallest one possible). This makes for a better experience, especially on mobile. This uses the new WP 3.5 image code.
Yes! (the only exception being themes with no standard posts or pages)
When activated, the <img>
tag is replaced by the <figure>
tag, and the alternate image sizes are provided in a way that only jQuery can access/load. If jQuery isn’t available, it falls back to the regular image you had there in the first place.
It also takes on any classes or alternate titles from the original image. It does not make any changes to your database (i.e. content or images that you already have remain untouched).
Follow me for updates at @noeltock
If you have technical issues or other enhancements that you’d like to contribute, please do so in the form of a pull request or issue here:
https://wordpress.org/plugins/hammy/
Kindly post any issues, questions or suggestions on the Hammy forums .
Video Walkthrough
Hammy already starts working upon activation, so any configuration is optional:
hammy
to the /wp-content/plugins/
directoryfigure.hammy-responsive
, in a way that it is identical to any img
styling used for your content area.The width of your browser is quite different than that of the post/page container (i.e. #content). By being able to measure the width of the content container instead of the browser window, you’ll ensure far better accuracy at all breakpoints.
If your website is 960px wide, but the content (#content) is only 600px, then 600
is your largest breakpoint. If the next smaller size is iPhone landscape (where the sidebar is also positioned underneath the content) and you have a 10px margin on either side, that breakpoint is 460
(480 minus 20), and so forth.
At the end, your breakpoints may look like 300,460,600
You have the ability to ignore certain classes (i.e. “.gallery-thumb”), but please let me know of any edge-cases on the Hammy forums
Hammy is possible through two awesome open source projects:
They’re both worth checking out and getting a better understanding of (or using in your mega-awesome WordPress client projects).
Hammy, from the movie “Over the Hedge”, he’s quite fast, like these images. Be sure to check out the movie for full appreciation.
figure
as opposed to picture
for larger compatibility (especially IE). Check your CSS to make sure figure acts like an image.$content_width
if available.