Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
After adding custom code to functions.php to populate post grids in a second language, the 'Intro' field from Unlimited Elements Post Grid is not translating correctly and is pulling data from the original language post.
Solution:
We recommend the following steps to address the issue:
1. Navigate to WPML > Settings and temporarily switch to the Classical Editor.
2. Complete the translations that were problematic.
3. Return to WPML > Settings and switch back to the Advanced Translation Editor (ATE).
4. Continue and finish translating the post.

If this solution does not resolve your issue or seems outdated, we highly recommend checking for 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. Should the problem persist, please do not hesitate to open a new support ticket at WPML support forum for further assistance.

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 21 replies, has 2 voices.

Last updated by justinK-16 4 months, 1 week ago.

Assisted by: Christopher Amirian.

Author Posts
July 6, 2024 at 3:04 pm

justinK-16

Background of the issue:
Hi Guys
Kor (from WPML Support) helped me with this a few days ago, and we closed the ticket.
This was the thread:
https://wpml.org/forums/topic/unlimited-elements-post-grid-post-query-field-does-not-appear-for-translation/#post-15821711

After some investigation, Kor escalated to 2nd Tier support and came back with some code to add to functions.php
I added the code and it all looked good to me, it populated Post grids in the second language, but unfortunately I missed a fairly obvious field. Unlimited elements call it the "Intro" - see attached screenshot.
Since then all Posts that I update and save in the ATE - Translate the actually post perfectly.
But, the Unlimited Elements Post Grid element - populates the Title, Date from the translated post but appears to be grabbing the "Intro" text from the original post.

Symptoms:

Questions:
Can that code that was supplied be amended to correct this issue (I am assuming that the code is causing this only because I checked the date I added it and then looked at posts with these issues, and they have all happened right after the code was added).

July 6, 2024 at 4:29 pm
July 6, 2024 at 4:32 pm #15903807

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Would you please send us the login information of the website copy so we can troubleshoot the issue there without the fear of breaking something?

You can set the next reply as private to provide the info.

Thanks.

July 7, 2024 at 6:48 am
July 7, 2024 at 9:01 am #15906754

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Thank you for the information. I reported this to the second-tier support and I will get back to you as soon as I have an update.

Thanks.

July 7, 2024 at 12:56 pm #15907317

justinK-16

Hi Christopher

Thank you very much!

What I said in the last message about the post being edited on Saturday displaying correctly...it appears that now in ALL 5 languages the "intro" now displays in English...

It seems any old post that gets edited/updated nad saved then displays that "intro" section in English.

Thanks

July 8, 2024 at 5:47 am #15909867

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Thank you for the info. I am waiting for an answer from the compatibility team.

Thanks.

July 9, 2024 at 3:02 pm #15921580

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

I have an answer:

on the original workaround, I set to call default posts as true as everything was translated in the Sandbox.
Now, I set both conditions as false and updated the previous workaround and the staging website:

$translated_id = apply_filters('wpml_object_id', $id, $post_type, false);

Would you please do the change and check?

Thanks.

July 9, 2024 at 3:36 pm #15921884

justinK-16

Hi Christopher

I copied the code that was updated in the staging site to function.php in the live site but nothing seems to have changed.

I checked a few different Post Grid widgets on different pages and some posts still have Engish "intro".

Also, the Staging site home page - the middle post in the top Post Grid is in English as are a mix of posts in the POst Grids on all pages

July 11, 2024 at 1:04 pm #15935214

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

I only can check the staging website and in your reply you have mentioned that the middle post of the top grid is not translated. But that is not the Element in question that we gave the workaround for.

That is a slider that contains information added there in the settings manually. (please check the screenshot)

Also, the workaround we provided is only for scenarios that you select the manual selection mode of that specific Element.

For other scenarios or elements we surely will need the developers of the plugin/theme help and can not do it alone.

But for now if you find a scenario int he staging website that does not work with the manual selection of the posts please inform and we will follow up.

thanks.

July 11, 2024 at 1:15 pm #15935257

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

It seems I misunderstood the issue you are talking about is the one under Our Popular Posts correct?

I asked the second tier support as that specific grid is a manual selection.

Waiting for their reply

July 11, 2024 at 1:26 pm #15935340

justinK-16

Hi Christopher

Yes correct i was talking about the Post Grid below Our Popular Posts - just as an example.

But so you are aware, when the code was supplied originally (I am aware it was for manually selected posts) it also affected our other Post Grids that had different post selection methods used (all from the standard settings within the Unlimited Elements Post Grid widget).

If you could please let the second tier team know this also as obviously it is no good fixing one issue that will then affect another that was working fine.

Thanks for your help 🙂

July 12, 2024 at 6:39 am #15940264

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

I informed the second-tier. The issue seems to be deeper and they could not find a solution for that specific post on the homepage and the only solution was to recreate the post.

So just to be cautious that might be the final answer at the time being as this needs more investigation by the plugin developer to have a solution.

Thanks.

July 12, 2024 at 7:04 am #15940415

justinK-16

Hi Christopher

So are they still looking into the problem or are you saying it can't be fixed at this point?

I don't know that re-creating the post is going to solve this - it may have just been luck that it worked for 2nd Tier (recreating a post).
I say this because I have been doing both - creating new posts and translating posts created 2 months ago - and sometimes the Post Grid post displays the intro in English and sometimes it correctly translates the intro (and everything else).

Also, I can't possibly create a post, translate it, and if it doesn't work - start again. That's a huge task (and a waste of translation credits).

I'm hoping they may still find a solution 🙂

July 15, 2024 at 3:11 pm #15955270

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

The second-tier support came back with a request to have a copy of the website that is smaller than the current one.

Would you please follow the steps below to provide us a copy of the website with a reasonable size so our second-tier support can download and do testing on their machine?

https://wpml.org/faq/provide-supporters-copy-site/

Just to make sure we are on the same page, our team did their best but there can not be a solution yet due to the complexity of the matter.

We unfortunately can not give guarantee for compatibility for that Grid item but we will do our best.

Thanks.