How can I add latest version number using cl_image_tag?
I would like to know how can I get latest version number and add it to img tag like,
<?php
echo cl_image_tag("filename",
array(
"width"=>150,
"crop"=>"thumb",
"version"=>"latest version number here"
));
?>
I just want to update CDN cache every time I overwrite the image.
-
When uploading a resource, our upload API returns back data which among other properties, includes the resource's version number.
You may save the version number (in a datastore) and use it as part of the cl_image_tag. This will make sure that you always use the latest resource version. More information can be found at http://cloudinary.com/documentation/upload_images#image_versions0 -
Thank you for your answer.
Currently I have several issues. The biggest one is when I try to include the php files to my Wordpress, it says
Cannot redeclare class Cloudinary in /home/users/0/lolipop.jp-ateliersasaki/web/wp-content/themes/sasaki-theme/Cloudinary.php on line 2
And then I did
if(!class_exists('Cloudinary')){
require('Cloudinary.php');
}
to avoid this error. I would like to know how can I fix this first.
0 -
Hi, did you try to search your code for another occurrences of this line?
require('Cloudinary.php');
If there is no such redundancy, then could you please try to follow the steps described on the next KB article and see if it helps?
https://support.cloudinary.com/hc/en-us/articles/202520202-I-m-experiencing-an-issue-with-Cloudinary-s-WordPress-plugin-What-can-I-do-I look forward to hear of your progress.
0
Post is closed for comments.
Comments
3 comments