Plugin Author
sbouey
(@sbouey)
Hi,
It’s seem you make it normally,
Can you put a screen capture for the 6) and 7)
What is your theme ? how you display the captions in front-end ?
Stéphane
Thread Starter
dejank
(@dejank)
Hello again,
My theme is custom, I made it from scratch.
Because of that i display captions in three ways:
1. Captions on Featured image:
` <?php if ( has_post_thumbnail() ): ?>
<?php $caption = get_post(get_post_thumbnail_id())->post_excerpt;
endif;?>
<?php echo $caption ?>`
2. Captions on images uploaded via ACF:
` <?php // ACF IMAGE (ID) – MAKE SURE FIELD IS SET TO ‘Image ID’
$img_acf = get_field(‘home-whw-img’);
$img_acf_caption = get_the_excerpt( $img_acf ); ?>
<?php if( $img_acf )
echo $img_acf_caption; ?>`
3. Captions on images uploaded via plugin ‘ACF Photo Gallery Field’ (note that this is plugin for ACF, not actually ACF) :
` <?php $images = acf_photo_gallery(‘homegallery’, 472);
if (count($images)):
foreach ($images as $image):
$id = $image[‘id’];
$title = $image[‘title’];
$full_image_url = $image[‘full_image_url’];
$full_image_url = acf_photo_gallery_resize_image($full_image_url,
1600, 900); ?>
<?php echo wp_get_attachment_caption( $id ); ?> `
Note: all images is uploaded from Media with both Default and English captions entered. None of three different ways works on front-end
sending screenshots via e-mail
thank you
Dejan
-
This reply was modified 3 years, 9 months ago by
dejank.
Plugin Author
sbouey
(@sbouey)
Hi,
I was in contact by mail with Dejan
here is the solution for the 1)
<?php echo wp_get_attachment_caption(get_post_thumbnail_id()); ?>
but don’t forget to publish in Falang > Translation post the attachment translation
Stéphane
Thread Starter
dejank
(@dejank)
Hi, solution for 2) and 3) :
no need to change code, as in 1). you only need to publish image in: Falang > Translate Posts > (search image by filename) > Publish
Note: you also put translation at the same place, no need to search for the image in Media.
Thank you Stephane, you are the best!
Plugin Author
sbouey
(@sbouey)
Perfect ,
Thanks for your message.
Stéphane