That would work if I only had a few posts. But I’d have about 400 images and 400 sets of coordinates to input by hand. I don’t have time to do all that. I’d like to figure out a way to have it built in PHP and run whenever a new post is created.
In non-code terms this is what I’m trying to figure out:
when a new post is published run:
loop through all posts
if (post has thumbnail) { add post thumbnail to image sprite, copy coordinates inside sprite }
end loop
append css for sprite coordinates, clear css browser cache
As an alternative, I’m also just trying to figure out how to speed up my page load time for the homepage and all image-populus pages. I currently average 4.25 seconds for the homepage to load.