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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
13:00 – 17:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - |
- | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: Asia/Jerusalem (GMT+03:00)
This topic contains 9 replies, has 2 voices.
Last updated by Eran Helzer 1 year, 8 months ago.
Assisted by: Eran Helzer.
Author | Posts |
---|---|
July 27, 2023 at 7:11 pm #14113305 | |
wei-chunT |
I'm translating pages including custom post types. Take this page as an example; I followed the documentation on I have a second question, on the page Thanks in advance. |
July 28, 2023 at 8:16 am #14115381 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Regarding the first issue, can you please explain to me how the field is added to the English version? Also, from the debug information you supplied I can see that the WordPress memory limit is set to 40MB. You should increase this to 128MB, as that is the minimum requirement for using WPML in the best way. Regarding the second question, are you sure the page is translated to Chinese correctly? If it isn't, the language switcher will not show. Please update me with this additional information. |
July 31, 2023 at 3:55 am #14123561 | |
wei-chunT |
I just realised my reply to the email wasn't posted here. Hi Eran, I've made the a video recording for my reply. Looking forward to your reply. Thanks. |
July 31, 2023 at 6:49 am #14124257 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Okay, thanks for the recording. Let me answer your questions first, then address the issue. 2 - In the same field group, on the bottom of the page there is a "Multilingual Content Setup" section. That is related to translating field titles and labels, but you do not need to change it (leave it as "Do not make "Field Groups" translatable"). Now, regarding the issues: 2 - Missing field from frontend: |
August 2, 2023 at 8:57 am #14140089 | |
wei-chunT |
Hi Eran, Here's my follow up questions, and question you missed in my last post:- See the video for the info:- Looking forward to your reply. New threads created by Eran Helzer and linked to this one are listed below: https://wpml.org/forums/topic/font-size-for-some-pages-is-not-correct/ |
August 2, 2023 at 10:54 am #14141469 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Okay. 1. Using WPML -> String Translation, no additional configuration needed Please make sure to have a working backup of your site before proceeding. I have set your next reply to be private so you can share credentials there. |
August 4, 2023 at 1:00 pm #14155059 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Okay, some updates. 1. After looking at how Visits are configured and created, I understood that the fields on the frontend are not the ACF fields. For example, "Address" is a combination of "Address Street Name" "Address Country" and "Address Postal Code". Thus, I concluded that the "Address" string is coming from the theme itself. What I saw is that the field titles themselves were not registered for translation. I edited the file to register the "Address" string. $field_html = field_to_html_info($field_v, "Address", ""); To: $field_html = field_to_html_info($field_v, __("Address", "divi-child"), ""); Then, I rescanned the theme using WPML -> Theme and plugins localization, translated the text using String Translation, and now the Chinese version is translated ("Address CH") What you need to do is the same for the rest of the field titles, rescan the theme and translated them. 2. + 3. Here I looked at your function-ajax.php. It looks like you are not filtering based on language at all. Since this is custom code, you need to do the post language filtering yourself. One way I can think of is filtering the posts using the "wpml_post_language_details" along with the "wpml_current_language" hooks. Please take a look at our documentation here on how to use it: 4. Let's handle the others first, then get to this I now understand that the issues are coming from custom code. This is outside of our support policy, so we can not take responsibility for any of the code or the suggested solutions. I will, of course, do my best to help, but please take this into account. I will get back to you on points 2 and 3. |
August 7, 2023 at 11:16 am #14163115 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
One more update. The 2nd tier have replied to about 2. and 3. Please try to add this argument to the get_posts call in the function-ajax.php file: 'suppress_filters' => false This should make the request filter posts by the current language. |
August 7, 2023 at 12:54 pm #14163899 | |
wei-chunT |
Hi Eran, I'm should be able to fix the issue 1 (post type field labels) now from what you mentioned. The code you suggested but the code doesn't solve issue 2 - Custom post page doesn't show any translated post items after switching language. Any suggestion? |
August 7, 2023 at 3:04 pm #14164795 | |
Eran Helzer Supporter
Languages: English (English ) Hebrew (עברית ) Timezone: Asia/Jerusalem (GMT+03:00) |
Great, happy to hear that some issues are solved. Regarding 2, now it is a matter of debugging. With the "suppress_filters" the language filtering should have solved this. I suggest you debug this, somewhere in the request an argument is being provided that causes none of the posts to return. I would suggest you go by elimination, removing arguments from the get_posts call until something is returned, then you'll know what the problematic filter was. Regarding issue 4, I would prefer to split it into a new ticket. It is our policy to keep it to one issue per ticket, that way everything is organized and clear. |
The topic ‘[Closed] Some ACF field not showing in translated pages frontend’ is closed to new replies.