Forums

WP Super Cache
Thumbnail link bug (2 posts)

  1. stormdude
    Member
    Posted 3 months ago #

    Hi,

    The WP Super Cache really makes my site zoom, but unfortunately I have some code that is getting mashed up when the WP Super Cache is enabled. I have the follow bit of code to link a thumbnail image:

    <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
    <li>
    <a href="<?php echo get_post_meta($post->ID, 'vendor_url_web', true);?>" target="_blank"><?php the_post_thumbnail('vendor-thumb');?></a>
    </li>
    <?php endwhile; ?>

    When the code is rendered with WP Super Cache enabled, the first loop is fine but all other loops produce something like this:

    <a href<img src="http://www.amazon.com/" target="_blank"><img width="150" height="45" src="http://www.mysite.com/us//wp-content/blogs.dir/4/files/2010/11/amazon.gif" class="attachment-vendor-thumb wp-post-image" alt="Amazon" title="Amazon" /></a>

    As you can see, the opening portion of an image tag is being inserted into the anchor tag. If I static the image tag rather than using the the_post_thumbnail function, it works as expected, but when I use the_post_thumbnail <img src= replaces the equal sign after the href.

    Any thoughts on a workaround? Help is much appreciated!!

    Thanks,

    Grant

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. stormdude
    Member
    Posted 3 months ago #

    It looks like it's the "wpsupercache_buffer" filter that is mangling my code. I've found a temporary workaround by comments out line 486 in wp-cache-phase2.php:

    $buffer = apply_filters( 'wpsupercache_buffer', $buffer );

Reply

You must log in to post.

About this Plugin

About this Topic