I'm trying to change the post thumbnail's attributes to support Lazy Load. This requires me to add a class of lazy, change the source to a placeholder image, and place the image source to into a data-original attribute.
I've done research and have referenced the documentation, but am still running into issues.
Here's the code I'm trying to use:
<?php
$tempimg = get_bloginfo('template_url') . "/img/grey.gif";
$default_attr = array(
'src' => $tempimg,
'data-original' => $src,
'class' => "lazy attachment-$size",
);
the_post_thumbnail('project-thumbnail', $default_attr);
?>
You'd think it would work, but once I use those attributes, the $src and $size variables don't work. They're just blank. Is there something I am missing?
Thanks in advanced.