Saltar navegación

Este hilo está resuelto. Aquí tienes una descripción del problema y la solución.

Problem:
The client is experiencing an issue where the featured image is not displaying on translated pages, even though it works on the original pages. The image is fetched using the WordPress function

the_post_thumbnail()

, but it does not appear on the translated versions of the pages.
Solution:
We recommend checking if the option to replicate images for translations is activated in the WPML settings. Here are the steps to follow:
1. Navigate to WPML > Settings.
2. Scroll down to the "Media Translation" section.
3. Ensure that the options shown in this screenshot are selected: https://prnt.sc/bAGWuTorCeY2
4. Click on "Start" to replicate the images for translations.

If the featured image still does not appear on the translated pages, it may be necessary to review the custom code. Ensure that the theme's code is using the necessary filters to retrieve the post thumbnail. You can also try using the WPML hook

wpml_object_id

, which is documented here: https://wpml.org/wpml-hook/wpml_object_id/

Please note that direct assistance with custom code issues is beyond our standard support scope. If you require further help with custom coding, consider hiring a developer from: https://wpml.org/contractors/

If the solution provided here is not relevant to your case, either because it's outdated or not applicable, 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. If the issue persists, please do not hesitate to open a new support ticket with us.

Este es el foro de soporte técnico de WPML, el plugin multilingüe de WordPress.

Todas las personas pueden leerlo pero solo los clientes de WPML pueden ingresar comentarios. El equipo de WPML responde en los foros 6 días a la semana, 22 horas por día.

Etiquetado: 

Este tema contiene 1 respuesta, tiene 2 voces.

Última actualización por Prosenjit Barman hace 9 meses, 3 semanas.

Asistido por: Prosenjit Barman.

Autor Entradas
Abril 22, 2024 en 5:40 pm #15552490

santiagoN

On all my page I have a big image on top of each page and post.

I'm getting this image (on the theme code) from the wordpress function "the_post_thumbnail()", this is working on my original pages.

Any of the translated pages for some reason are not printing the image.

you can check it on the following link:
enlace oculto

Can you help me with this ?

Screenshot 2024-04-22 at 19.35.42.png
Screenshot 2024-04-22 at 19.34.26.png
Screenshot 2024-04-22 at 19.33.41.png
Abril 23, 2024 en 8:14 am #15554196

Prosenjit Barman
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

To reduce the waiting time, I took this ticket and responded in English. Please let me know if you're okay with it or if you want to continue the conversation in Spanish. I will check and forward this ticket to one of our Spanish-speaking supporters to assist you in the Spanish language.

If the option to replicate images for translation was activated in your settings (illustrated here: enlace oculto) before adding translation, the images would be automatically transferred to the new language versions. However, given that the image markup is entirely missing from the translated page, this suggests there might be an issue with the integration of WPML translation support within your custom code to display the Thumbnail. This discrepancy could be the reason why the image isn't displaying on the translated page.

Could you please try the following and check if that helps in solving the issue?

- Please go to WPML > Settings and scroll down to the "Media Translation" section.
- Make sure that the options marked in this screenshot(enlace oculto) are selected and click on "Start"

After completing the process, please revisit the translated post and check whether the featured image is now visible.

If the featured image is still absent, it would be best to examine the custom code to ensure that your theme's code is properly using the necessary filters to retrieve the post thumbnail. In such instances, you can try the wpml_object_id hook provided by WPML: https://wpml.org/wpml-hook/wpml_object_id/

While direct assistance with custom code issues falls outside our standard support offerings, I'll try my best to assist by providing guidance and recommendations that can help you tackle this problem. If you need assistance with custom coding, you can consider hiring a developer from here: https://wpml.org/contractors/

I hope you can understand. Please let me know if you need further assistance in this matter.

Best regards,
Prosenjit

Abril 26, 2024 en 8:24 am #15568725

santiagoN

Hi Prosenjit,

the problem was solved with your approach.

Thank you for your support.