Home›Support›English Support›[Resolved] Media Translation and Houzez theme: edit alt text for "property images"
[Resolved] Media Translation and Houzez theme: edit alt text for "property images"
This thread is resolved. Here is a description of the problem and solution.
Problem: Unable to translate the alt text for 'property images' from English to German using the Media Translation feature in WPML. Despite changing the alt text in the Media Translation and Real Estate sections, the frontend displays the English alt text instead of the German alt text, and the backend reverts to the English alt text after saving. Solution: This issue is due to a compatibility problem with the Houzez theme. We have implemented a workaround by adding the following code to the functions.php file of your theme:
add_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10, 4);
function wpml_compsupp7300_filter_fave_property_images($null, $object_id, $meta_key, $single) {
// Target the specific meta key
if ($meta_key !== 'fave_property_images') {
return $null;
}
// Prevent recursion by temporarily removing the filter
remove_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10);
// Fetch the original meta value
$images = get_post_meta($object_id, $meta_key, $single);
// Re-add the filter
add_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10, 4);
// Check if we actually got an array
if (is_array($images)) {
foreach ($images as &$image_id) {
// Apply the WPML filter to each item (image ID)
$image_id = apply_filters('wpml_object_id', $image_id, 'attachment', true);
}
}
return $images;
}
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Additionally, you can open a new support ticket for further assistance at WPML support forum.
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.
Background of the issue:
I can change the alt text everywhere, but not in the pictures of the property.
I am trying to edit the alt text for 'property images' from English to German using the Media Translation feature in WPML. After adding the image again under the german property, the alt text is correctly displayed in German. But after saving, the frontend is not displayed in German.
The issue can be seen on this page: hidden link
Symptoms:
Despite changing the alt text in the Media Translation and Real Estate sections, the frontend displays the English alt text instead of the German alt text. Additionally, the backend reverts to the English alt text after saving.
Questions:
Why is the alt text for 'property images' not updating to German on the frontend?
Why does the backend revert to the English alt text after saving?
Welcome to the WPML support forum. I will do my best to help you to resolve the issue. A couple of requests for tracking the issue.
1) Please share a couple of screenshots for a better understanding of the problem. Because we are not able to reproduce it exactly here - hidden link
2) Please fill in the private details fields after a full site backup{mandatory}. I would like to access the admin area of your site to check further. Refer to the following links for more details about our private information sharing policies.
Thank you for the detailed information and credentials. Please try the following steps after a site backup and make sure the issue exists or not.
1) Please visit WPML>>Settings>>Media Translation
2) Choose the *How to handle media library texts: >> Translate media library texts with posts* option and save the changes
3) Open the post for editing in the original language - hidden link
4) Make a minor change in the content and save it (to refresh the translation settings)
5) Update the translation
Please refer to the following tickets for more details
Unfortunately, it didn't work. The English alt text is still displayed on the German page. I have carefully done all your points:
1) Please visit WPML>>Settings>>Media Translation ---- DONE
2) Choose the *How to handle media library texts: >> Translate media library texts with posts* option and save the changes ---- DONE
3) Open the post for editing in the original language - hidden link ---- DONE
4) Make a minor change in the content and save it (to refresh the translation settings) ---- DONE
5) Update the translation ---- DONE
Thank you for the feedback. Please create a dummy blog post and property post with an image for testing. Try the following steps and check whether it shows the expected results.
1) Visit WPML>>Translation Management Dashboard
2) Choose the newly added posts for translation
3) Send it to Translation Basket
4) Visit WPML>>Translation Management>>Translation Basket
5) Send it for translation, by choosing yourself as a translator
6) Visit WPML>>Translations queue and translate the page by clicking the *Translate* button
Everything was done exactly according to your new instructions. Unfortunately without success. After done translation job: English "alt text" is displayed in the German version.
I found out the following after completing the translation job:
1) in the DE property the EN alt text is displayed
2) in WMPL - Media Translation - DE image the correct German text is displayed
3) Even if I try to embed the property image again in the DE property, it doesn't work.
4) even if I change and update the DE text at WMPL - Media Translation again, no success
Thank you for the feedback. Please allow me to make a copy of your site using the Duplicator plugin (https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server. So we can troubleshoot the bug without affecting your live site.
Hi Bigul!
Just to be sure. If you use the Duplicator plugin, there are no conflicts with the purchase codes anyway? Because I can only use my Houzez theme, plugin, etc. on one domain. If that's not a problem then please do it with the Duplicator plugin.
Please note. I created a "post" yesterday and everything worked perfectly with the media translation. So the error must be specifically related to the houzez theme "property" translation.
Thanks for your support!
Thank you for the updates. This may be a compatibility issue. Please note, your live site will not have any effects, if we make a Duplicator copy. But take a full site backup.
Thank you for the updates and permission. I made a copy of the site now, will debug it further locally and get back to you as early as possible. Please wait.
Please don't stress about this case. I have found another bug in the meantime. If you are already working "locally" on my case, can you please look at this error?
Situation: it works on the EN landing page (montecarloresidences.com) but not on the translated pages: DE FR IT
If you click "FOR RENT" and "Price max" on the EN landing page, the amounts I entered appear, such as 2000€, 5000€, etc.
Problem: These amounts do not appear on the DE FR IT page.
I was able to set these amounts on Houzez here: Houzez Theme Options - Searches - Settings - Maximum Prices List for Rent Only
I tried to edit something on the DE landing page (in elementor) and save it. But no success. I think this error has always existed but I have only seen it now.
Thanks for your support!
New threads created by Bigul and linked to this one are listed below:
Thank you for the updates. The bug exists in my local copy after the initial checks. So consulting with our team for an expert opinion now.
Please note that I have opened a new ticket for the Rent price issue. As per our support policies, we can only handle one issue per ticket. It will help us to serve you better and we can avoid discussing multiple problems in one ticket.
I will get back to you soon on the latest ticket. Please wait. Thank you for your understanding.