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 thread is resolved. Here is a description of the problem and solution.

Problem: What I'm trying to do is display the 3 most recent articles as previews in a page. The problem is that on the French (main language) side, everything work fine. However, on the english version, the thumbnails images are not shown. Solution: Go to Dashboard → WPML → Settings → Media Translation (make sure that you installed the WPML Media Translation plugin), and press the Start button.

This topic contains 4 replies, has 2 voices.

Last updated by agenceW 2 months, 3 weeks ago.

Assigned support staff: Radu.

Author Posts
July 22, 2019 at 1:21 pm #4257765

agenceW

What I'm trying to do: display the 3 most recent articles as previews in a page

The link to the specific page: hidden link

Informations on WP and WPML: WordPress 5.2.2–fr_FR / main language is French, second is English / using a custom made theme, working fine with WPML / plugins all working fine

The program: (see attached screenshot for reference) the code snippet gets the 3 most recent articles, and extracts their name, date of posting, excerpt, thumbnail, ..., then displays them as little previews for the user to click on and be redirected to the complete article

The problem: on the French (main language) side, everything work fine. However, on the english version, the thumbnails images are not shown

Possible source: the function used to retrieve the image is get_the_post_thumbnail_url($the_post["ID"]). But since the English article is a "different one" from the French, the function may not be able to find the attached thumbnail via its ID

Question: is there a function to get the thumbnail from the original article? If not, is there an alternative way to solve this problem?

Thank you in advance for your help!

July 22, 2019 at 8:26 pm #4261143

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey,

Thank you for reaching out the WPML support!

There's one check that we need to make first. Can you edit one of the three posts, and make sure that the Duplicate featured image to translations option is checked, please? If it's not already, check it, and hit the Update button. Can you tell me if the featured images are shown now on the English page, please?

Thanks,
Radu

July 23, 2019 at 8:27 am #4263823

agenceW

Hi, thanks for your quick answer

I checked the option on all of the articles, and it was already active. I then edited some words here and there to update the articles, but the images still didn't show...

A weird thing happend though: dev-alyzia.fr is a developpment site (as the url suggests), the live one being alyzia.com. I added the updated articles code to the live website because even without images, the client wanted english articles to be readable. And on this case, the images showed!

What's really weird is that the code on the two websites is the exact same, copy-pasted form dev to live, but it seems to work fine on the live one: hidden link

I'm unsure why this happens, but at least it works on the right website. The get_the_post_thumbnail_url() function doesn't seems to be the source as I first thought.

If you'd like further informations or details from me about this issue, I'll stay available. For now, the problem is "solved", but I'll run some tests on my side to try to understand where that image issue came from, so it can be prevented in future usages of WPML.

July 23, 2019 at 8:59 pm #4268875

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey,

You can try to go to Dashboard → WPML → Settings → Media Translation (make sure that you installed the WPML Media Translation plugin), and press the Start button. This might do the trick for the missing images on the website. Or if you already found the source of the issue, you can share it so other users can use it if they run into it.

Thanks,
Radu

July 29, 2019 at 3:01 pm #4301307

agenceW

I tried to go to Media Translation (we always install it with WPML) and activating it, but it still doesn't show images on the developper website...

But we didn't encounter a single problem for now with the live version, so I'll consider the problem solved. It is possible that our dev site encountered some server problems in the past that lead to this image issue, since some technical tests were done on it on the beginning of the project.

Thanks for your support!