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; }
Please ensure to perform a full site backup before applying this workaround. For more details on this issue, refer to the errata page at https://wpml.org/errata/houzez-property-media-images-not-showing-translated-alt-text/.
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.
This topic contains 18 replies, has 2 voices.
Last updated by 4 weeks, 1 day ago.
Assisted by: Bigul.