• Resolved dejank

    (@dejank)


    Hello Stéphane,

    i try to translate captions on images uploaded in Media.
    here are the steps:
    1. In Falang settings / Translate Post Types turn on Media
    2. Update settings clicked
    3. Media / Options clicked
    4. Checked everything except _wp_atachment_image_alt
    5. Save options
    6. captions written on default language and other language tab (en) in captions field.
    7. same captions from default language displayed, no translation.

    latest version of plugin is used. What am I doing wrong?

    thank you and great great plugin. Bravo!

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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 2 years, 7 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘translating captions’ is closed to new replies.