WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Simple Post Thumbnails] Need a random value in thumbnail preview url to avoid browser cache (2 posts)

  1. zilong
    Member
    Posted 4 years ago #

    When you upload another pic after a first one, the preview still show the previous one, because the browser cached the previous thumbnail image.

    Adding a random value (i.e &random=128578291752891) at the end of
    /wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wordpress/wp-content/thumbnails/1.jpg&w=200&h=150&zc=1&ft=jpg will solve this issue.

  2. zilong
    Member
    Posted 4 years ago #

    for those who needs a quick fix, edit simple-post-thumbnails/thumbnail-poster.php

    Change:
    <img style="border: 1px solid #ccc; padding: 3px;" src="<?php echo $thumb; ?>" alt="Thumbnail preview" />

    to

    <img style="border: 1px solid #ccc; padding: 3px;" src="<?php echo $thumb."&random=".rand(); ?>" alt="Thumbnail preview" />

Topic Closed

This topic has been closed to new replies.

About this Topic