• I am currently using the following code to lazy load images on my page which are clickable and link to the latest posts in their respective categories srizzil.com/watch:

    <a class="image-link" href='<?php the_permalink(); ?>'>
    <img class="<?php echo $class; ?>" src="<?php echo get_bloginfo( 'stylesheet_directory' ); ?>/images/grey.gif" data-original="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>" alt="" />
    </a>

    The problem is it is taking the largest generated image and shrinking it using HTML. How can I tell it to pull one of the wordpress generated thumbnail sizes instead? I have tried using ‘get attachment image,’ and ‘get_the_post_thumbnail’ but these break the code.

    [ No bumping please. ]

  • The topic ‘Pulling an image and an url’ is closed to new replies.