Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: 

This topic contains 14 replies, has 0 voices.

Last updated by mohamedA-110 1 day, 1 hour ago.

Assisted by: Andreas W..

Author Posts
September 19, 2025 at 4:01 pm #17417403

mohamedA-110

Background of the issue:
I am trying to translate an image on my site hidden link using WPML.

Symptoms:
Some images are not being translated using media translation.

Questions:
Why are some images not being translated using media translation?

September 19, 2025 at 7:16 pm #17417703

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Please take a complete backup of your site, including the database.

Now go to Plugins > Add new and click on the commercial tab.

Click "Check for Updates" and install the latest versions of our plugins.

Now, verify if the issue persists.

If the issue persists, go to WPML > Media Translation and edit one of the translations.

Usually, a dialog should show up and ask to sync the media.

If the dialog will not show up, please try re-uploading a file to the second language, editing its translation, and saving.

Then run the dialog to sync the media.

If this does not solve the issue, please let me know.

Best regards
Andreas

September 22, 2025 at 6:04 am #17419906

mohamedA-110

Hello,

I did all of the above and the problem is still there sadly

September 23, 2025 at 6:38 am #17423541

mohamedA-110

hello,
any help?

September 23, 2025 at 7:00 am #17423583

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to offer to take a closer look and request temporary access (wp-admin and FTP) to the website to investigate the issue further.

The required fields are located below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.

IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website credentials will be set to "PUBLIC." DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose.

If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/account/websites/.

If you are unable to provide such a copy of the website for testing, please let me know on this ticket.

The private reply form looks like this:
hidden link

Click "I still need assistance" the next time you reply.

Video:
hidden link

Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form.

Best regards,
Andreas

September 27, 2025 at 5:02 am #17437595

mohamedA-110

I still need assistance but I couldn't add my credentials normally a page with a form opens..

September 27, 2025 at 2:46 pm #17438088

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I will be glad to help!

The private reply form is enabled again. It looks like this:
hidden link

Click "I still need assistance" the next time you reply.

Video:
hidden link

September 30, 2025 at 2:54 am #17442470

mohamedA-110

any answer here please?

October 1, 2025 at 3:59 am #17447013

mohamedA-110

Hello, any help? normally I get my help directly..

October 1, 2025 at 4:36 am #17447040

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

The reported issue appears to be a compatilbity problem between the Real Homes theme, Easy Real Estate plugin, and WPML Media Translation.

A workaround that could usually be applied in this case:

Keep using WPML Media Translation to upload media for second languages, but keep in mind that for Listings, you need to additionally apply the following workaround.

Instead, go to WPML > Settings > Custom Field Translation and search for the field "REAL_HOMES_property_images".

Unlock the field and set its translation preference to "Don't translate".

This means that now, when translating a listing, the images will not be copied over, and you will be able to select the images manually on the translated post.

Further steps:

I can offer to provide a WPML test site on which you can install the latest versions of the Real Homes theme and the Easy Real Estate plugin, so that we can try to replicate the issue. This way, we can confirm if this is a general issue and take further steps.

Would this be possible?

October 2, 2025 at 5:17 am #17450510

mohamedA-110

hello,

thank you so much, but I can't install my theme anywhere else because I only have one key for it..
thank you for your help, but normally they tell me to save the image name somewhere in the translation and that way it will be taken with the needed ID depending on the language, but sadly I forgot the way therefore I couldn't try it..
Could this be a possible solution?

thank you for you help again.

October 2, 2025 at 8:58 am #17451113

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

If you are trying to display different images in different languages, then you will need to upload alternative media files for the second languages as WPML > Media Translation.

If you plan to use the same image in both languages, I suggest you verify the settings at WPML > Settings > Media Translation. There, you find options for duplicating media, which means that WPML creates one entry for each image inside the media library. Also, you find an option to make any metadata from images available inside the WPML Translation Editor.

More about WPML Media Translation:
https://wpml.org/documentation/getting-started-guide/media-translation/

---

About the issue on your site:

I can offer to create a local copy of the site and investigate further. I suspect that the issue is that the slider on this template is simply not expecting any different ID for media in second languages, and this is why it displays the original media file.

This should be solveable by applying one of WPML's hooks. I will try to find a solution, but note that this final fix will need to be implemented by the plugin author, not by WPML.

October 2, 2025 at 2:32 pm #17452429

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

As I mentioned earlier, the theme must make use of WPML Hooks to achieve compatilbity with WPML.

The following adjustments need to be made:

In the file\wp-content\themes\realhomes\assets\classic\partials\property\single\slider-one.php

Replace:

$properties_images = $args['gallery'];

				foreach ( $properties_images as $prop_image_id => $prop_image_meta ) {

					echo '<li>';
					if ( 'true' === $args['lightbox'] ) {
						echo '<a href="' . $prop_image_meta['full_url'] . '" data-fancybox="gallery" class=""  data-caption="' . $prop_image_meta['title'] . '">';
					} else {
						echo '<a href="' . $prop_image_meta['full_url'] . '" data-fancybox="gallery" class=""  >';
					}
					echo '<img src="' . $prop_image_meta['url'] . '" alt="' . esc_attr( $prop_image_meta['title'] ) . '" />';
					echo '</a>';
					echo '</li>';
				} 

with:

foreach ( $properties_images as $prop_image_id => $prop_image_meta ) {
					if ( class_exists( 'SitePress' ) ) {
					$current_language = apply_filters( 'wpml_current_language', null );
					// WPML is active — use translated media logic
					$translated_image_id = apply_filters( 'wpml_object_id', $prop_image_id, 'attachment', false, $current_language ); 

					$slider_thumb = wp_get_attachment_image_src( $translated_image_id, 'property-detail-slider-thumb' );
					$full_url     = wp_get_attachment_url( $translated_image_id );
					$title        = get_the_title( $translated_image_id );
					$image_url    = wp_get_attachment_image_url( $translated_image_id, 'full' );
				} else {
					// WPML not active — fallback to original image logic
					$slider_thumb = wp_get_attachment_image_src( $prop_image_id, 'property-detail-slider-thumb' );
					$full_url     = $prop_image_meta['full_url'];
					$title        = $prop_image_meta['title'];
					$image_url    = $prop_image_meta['url'];
				}

					echo '<li data-thumb="' . esc_url( $slider_thumb[0] ) . '">';
					echo '<a href="' . esc_url( $full_url ) . '" data-fancybox="gallery-images" title="' . esc_attr( $title ) . '">';
					echo '<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $title ) . '" />';
					echo '</a>';
					echo '</li>';
				}

And in the file \wp-content\themes\realhomes\assets\modern\partials\property\gallery\default.php

Replace:

$properties_images = $args['gallery'];

				foreach ( $properties_images as $prop_image_id => $prop_image_meta ) {

					echo '<li>';
					if ( 'true' === $args['lightbox'] ) {
						echo '<a href="' . $prop_image_meta['full_url'] . '" data-fancybox="gallery" class=""  data-caption="' . $prop_image_meta['title'] . '">';
					} else {
						echo '<a href="' . $prop_image_meta['full_url'] . '" data-fancybox="gallery" class=""  >';
					}
					echo '<img src="' . $prop_image_meta['url'] . '" alt="' . esc_attr( $prop_image_meta['title'] ) . '" />';
					echo '</a>';
					echo '</li>';
				}

with:

$properties_images = $args['gallery'];
				$current_language = apply_filters( 'wpml_current_language', null );

				foreach ( $properties_images as $prop_image_id => $prop_image_meta ) {

					// Check if WPML is active
					if ( class_exists( 'SitePress' ) ) {
						// Get translated attachment ID
						$translated_image_id = apply_filters( 'wpml_object_id', $prop_image_id, 'attachment', false, $current_language );

						// Retrieve translated media data
						$full_url  = wp_get_attachment_url( $translated_image_id );
						$image_url = wp_get_attachment_image_url( $translated_image_id, 'full' );
						$title     = get_the_title( $translated_image_id );
					} else {
						// Fallback to original media
						$full_url  = $prop_image_meta['full_url'];
						$image_url = $prop_image_meta['url'];
						$title     = $prop_image_meta['title'];
					}

					echo '<li>';
					if ( 'true' === $args['lightbox'] ) {
						echo '<a href="' . esc_url( $full_url ) . '" data-fancybox="gallery" data-caption="' . esc_attr( $title ) . '">';
					} else {
						echo '<a href="' . esc_url( $full_url ) . '" data-fancybox="gallery">';
					}
					echo '<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $title ) . '" />';
					echo '</a>';
					echo '</li>';
				}

With those adjustments, the sliders of the theme will display the correct translated image from WPML Media Translation.

Note that in this case, the custom field "REAL_HOMES_property_images" should remain on its default setting "Copy" at WPML > Settings > Custom Field Translation.

I suggest you propose this fix to the theme author:
hidden link

I am further escalating the issue internally, so that our compatilbity team can follow up with Real Homes on this matter.

In case further assistance from our end will be needed, please let me know.

October 2, 2025 at 4:25 pm #17452664

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

We would like to inform you that we have a better workaround for the reported issue.

At WPML > Settings, on the tab Custom XML Configuration, add:

<wpml-config>
  <custom-fields>
    <custom-field action="copy" type="post-ids" sub-type="attachment">REAL_HOMES_property_images</custom-field>
  </custom-fields>
</wpml-config>

Now, update the original property and then update its translation.

Best regards
Andreas

October 6, 2025 at 3:56 am #17457970

mohamedA-110

Hello,

Thank you so much for your help this was a great solution it worked instantly, but I have one question should I be adding this code on every update of wpml plugin?