junaidbhura / auto-cloudinary

Super simple Cloudinary auto-upload implementation for WordPress.
https://wordpress.org/plugins/auto-cloudinary/
MIT License
41 stars 9 forks source link

is possible upload images from advance custom field to cloudinary ?? #24

Closed hdkcreative closed 5 years ago

hdkcreative commented 5 years ago

is possible upload images from advance custom field to cloudinary ?

the plugin in post and pages works good....

but for ACF ?

junaidbhura commented 5 years ago

Hi @hdkcreative . This plugin doesn't upload any images to Cloudinary. It just changes the URLs of the site, and Cloudinary then uploads it automatically.

Checking "Automatically use Cloudinary for all images" (https://github.com/junaidbhura/auto-cloudinary/wiki/Setup) will make this plugin try to change all IMG tags on the front-end. This means that if you use something like wp_get_attachment_image() it will work. But if you've hard-coded an IMG tag, it won't work.

Hope this helps!

hdkcreative commented 5 years ago

Hi @junaidbhura thank for response...

It just changes the URLs of the site, and Cloudinary then uploads it automatically. this work perfect, but don´t work for advance customs fields (advancedcustomfields.com).

when i check the "Automatically use Cloudinary for all images", Cloudinary don´t uploads it automatically. (works only for wordpress native pages and post )

Options: you can check this plugin with a custom post field ? ... or i can modify you code for integrate this funcionality (which is the file and method to modify) ?

thank and congratulations for the plugin

junaidbhura commented 5 years ago

Hey @hdkcreative thanks for the wishes! 😀

This plugin has been tested heavily with Advanced Custom Fields and works great. It really depends on how your theme is implemented. As long as you are using core WordPress image functions, it will work fine.

Again, if you are using raw <img src=""....> in your code, it will not work!

How are you using it?

hdkcreative commented 5 years ago

i am using the default theme.

and in the custom post i am using a FILE

view this image https://i.imgur.com/rJL5zPT.png

junaidbhura commented 5 years ago

Hi @hdkcreative the back-end doesn't matter. All the magic happens on the front-end. As long as you use core WordPress functions like wp_get_attachment_image etc on the front-end, this plugin will pick it up.

hdkcreative commented 5 years ago

hi @junaidbhura thank you for you response.

you want see my configuration ?

in post and pages work without problem.. .

but in custom files with ACF don´t work

djmtype commented 4 years ago

@hdkcreative In ACF, try returning the image as Display image (ID).

Then, in your theme template write:

<?php
$image1 = wp_get_attachment_image(get_field('image1'), 'large', 0, array('class' => 'image1'));

echo $image1;
?>
hdkcreative commented 4 years ago

@hdkcreative In ACF, try returning the image as Display image (ID).

Then, in your theme template write:

<?php
$image1 = wp_get_attachment_image(get_field('image1'), 'large', 0, array('class' => 'image1'));

echo $image1;
?>

thank you ! @djmtype , this issue is solved. we decided not to use the plugin anymore