Home › Forums › Add-ons › Gallery Field › Upload Image from External URL and add to ACF Gallery › Reply To: Upload Image from External URL and add to ACF Gallery
Thanks a lot @hube2 , i can now can upload images from external url and add them all to ACF Gallery.
still there is one more problem.
i’m using these line of codes:
// Set Fetched ArtWork as Post Thumbnail
$DownloadArtWork_Importer = media_sideload_image( $data['download_artwork'], $post_id, null, 'id' );
set_post_thumbnail( $post_id, $DownloadArtWork_Importer );
// Set Fetched ScreenShots as Post Gallery
$DownloadScreenShot_Importer = array($data['download_screenshots']);
foreach($DownloadScreenShots as $DownloadScreenShot) {
$DownloadScreenShot_Importer[] = media_sideload_image( $DownloadScreenShot, $post_id, NULL, 'id');
}
update_field( 'field_5d94fb71cf60f', $DownloadScreenShot_Importer , $post_id );
the ArtWork image (thumbnail) is attached to current post but screenshots (Gallery images) are not attached to wp post.
see screenshot below please:
i know it’s probably from WP not ACF but i’ll appreciate it if you can give me hint on how can i attach gallery images to wp post just like thumbnail …
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.