If this solution does not apply or is outdated, 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 open a new support ticket 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.
Background of the issue:
I have a relationship field where you can choose 'posts' (custom post type). The page gets translated and the individual custom post types are translated, but the pulled in cpts (title and excerpt). I can see the title/excerpt in the ATE and everything is translated but on the main page where I pull in each cpt, it is not translated. I did follow the rules for relationship and set this to 'copy'. I originally had it set to 'copy once' but I changed this and resaved. I then resaved the post and the page and re-saved both translations. I also tried adding a test word at the end of the excerpt, saving and resaving the translation. Nothing worked.
Symptoms:
The excerpts of custom post types are not translated on the main page, even though they appear translated in the ATE.
Questions:
Why are the titles and excerpts of custom post types not showing as translated on the main page?
Is there a specific setting in WPML that I might be missing to ensure excerpts are translated correctly?
I created the staging site, but I really don't understand how to show ACF fields on a default theme. How can I display ACF fields without writing the code to do so?
I did test the same type of relationship block that pulls in posts instead of custom post type and that translates properly. I also deactivated all plugins except WPML and ACF.
This was the explanation: To test if same issue happens when using WP default theme and only ACF and WPML. So you create same fields under ACF, add them to your page and select some other translated CPT, translate page and save. Check translated page and see if in field the translated CPT is connected.
The part I don't understand is "Check translated page and see if in field the translated CPT is connected." What am I looking for here? The page is blank since I haven't written the code into the default theme to display the ACF fields. Are you checking the database to see if the field is translated? I really don't understand and could use a better explanation.
Please provide the private form for me to upload the staging site credentials.
For what it's worth, I checked both the english and german pages in the database and for the relationship field they both show the same posts (cpts) being pulled in.
English page ID 3789:
a:3:{i:0;s:4:"3790";i:1;s:4:"3797";i:2;s:4:"3798";}
German page ID 4096:
a:3:{i:0;s:4:"3790";i:1;s:4:"3797";i:2;s:4:"3798";}
I am not sure exactly how this works, but I would think that the german page should show the German cpt IDs.
I was mistaken earlier about this working for posts. It doesn't work in my relationship fields for posts or custom post types. I have the translations set to copy for all relationship fields.
Also, if the only thing I include on the page is the relationship field, the translated page is blank. It seems like it's not recognizing the relationship field at all and I have to add another block of some sort to get the page to translate at all.
Sorry, one last bit of info. The link in the post is correct, so it leads correctly to the german post. The category is also correctly displayed in German. So, it's just the excerpt and title.
Thank you for contacting WPML support, I’m happy to help you with this issue.
Please share some screenshots of the issue, the page where I can see that. Then I would like to request temporary access (wp-admin and FTP) to your staging site to take a better look at the issue. Your next reply is set to private to share the info.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
There is an issue with the Relationship field when using preference "Copy" and translating the page with Advanced Translation Editor.
If I change the preference to "Copy Once"
'wpml_cf_preferences' => 3
and re-update the translation page manually with WordPress editor, the translation relationship is displayed correctly in the frontend.
No, that isn't working for me. The weird thing is that I already had these set as 'wpml_cf_preferences' => 3 because that was the recommendation I had received for these fields in past builds. I changed it to 1 to try to fix this issue. And in fact, several relationship fields (on Our Team, for example) were still set to copy once. I can see that you managed this for Lesson Plans on the staging site. I tried re-saving the page in English, then clicking through to the translation and re-completing the translation. This didn't work.
I am also noticing that the links to these pages are going to the EN page. I had also set these to copy, should these be copy once as well?
then you need to translate the URL manually in the Advanced Translation Editor. If you want to adjust the internal automatically, please set the preference to "Copy" ('wpml_cf_preferences' => 1)
I would like these to translate automatically but I did try changing preference to 1 and I could not get that to change. I also went into settings and clicked the button in the "Translate Link Targets" section to scan and translate links. I also resaved the pages with links. What do I have to do after changing this setting to "1" to get this to work automatically.
UPDATE: If I change 'wpml_cf_preferences' to "1" the button text gets copied so it is always in English. I want the button text to be translatable, but ideally the link itself is automatically adjusted to the translated version of the page. I thought I was able to do this in other sites I've built. Is this possible? If so, how do I do this?
New threads created by Long Nguyen and linked to this one are listed below: