Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function to add timestamp to image?
#1
Hi all,

I'm hoping there is some way I can add a timestamp to images within the content in order to prevent caching, but I'm not really keen to alter the core code. Can this be done with a function?

For example, within my client's template is <img src="<?php get_site_url(); ?>/data/uploads/image.jpg?<?php echo date("W");?>" /> which simply adds the week number to the end of the image, and means the image will not be cached forever until the user clears it.

How can I add the same timestamp to certain images which are called from within the content editor to prevent them being cached too? The images will be updated once every week or two, but the page content does not necessarily change.

If I HAVE to edit the core code, so be it (though I have no idea where) - but surely someone smarter than me can advise how I could create a function to achieve this.

Much appreciated! Blush
Reply


Messages In This Thread
Function to add timestamp to image? - by trmash - 2013-04-04, 15:52:26



Users browsing this thread: 1 Guest(s)