Call Images with Tag - WordPress Tag/Categories Pages
I have a Wordpress website with over 600 Categories. My aim is to upload the images and add a tag to them (potentially the category name). I would then call the image based on the tag.
My questions are
1. How would I do this for a wordpress website, is there a function or sample code available?
2. How do I integrate Cloudinary images to display them responsive for different screen sizes. I understand Cloudinary works by calling the image file and then adding the defined functions to the URL to display the desired image.
What I don't understand is how I would create individual URLs in the CSS file for so many different sizes?
e.g. Category 1 - Arizona Cardinals - If I have one image in the library what would be the best way to call it for different screen sizes, in the CSS?
I hope this makes sense.
Thanks
.
-
Hi Adam,
Thank you for reaching out to us.
We do have Wordpress plugin v2, which is currently still in beta. So I suggest to take extra precautious measures if you are going to do this on live/production environment. I highly recommend to try it first on your staging environment first.
With the plugin, you can take advantage of Cloudinary's transformation, optimization, and responsive images features.
Please give it a try and let me know if you need further assistance.
Regards,
Erwin Lukas0 -
Hi Erwin,
I have the plugin installed and I can upload images to my media library.
What I need to do is to call the images based on a tag I can put manually.
WordPress Use Case
Category Page = Arizona Cardinals (example: website.com/arizona-cardinals)
Image in Media Library: ArizonaCardinals.jpg (Tag of the image is set as: Arizona Cardinals)
Aim: On the Arizona Cardinals Category Page (website.com/arizona-cardinals) show the image ArizonaCardinals.jpg
Reason: I have hundreds of Category pages and don't want to manually upload each image to the category page.
Thanks for help or pointing in the right direction.
0 -
Hi Adam,
In case you already have the tags applied to the images uploaded to your Cloudinary account, once you open the editor of a category's page, you can click on "Add Media", navigate to the Cloudinary tab, click on the Advanced Search icon within the search bar and search by the relevant tag.
All associated images will be returned, then you can bulk select them all and click the "Insert" button and they will all be added in one go. You can then use them to create a gallery, right after the insertion process is completed.Is this a feasible solution for what you are trying to achieve?
With regard to the responsiveness of images, as Erwin mentioned, our beta v2 plugin does support it and it is implemented with the `srcset` attribute, once you enable breakpoints in your plugin's settings.
Best,
Raz0
Post is closed for comments.
Comments
3 comments