Skip Navigation

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.

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by incloI 1 year, 10 months ago.

Assisted by: Long Nguyen.

Author Posts
June 21, 2023 at 7:29 pm

incloI

Hello! I am using WPML on our staging site and none of my ACF custom fields that are assigned to specific pages are showing up in the second language. I am assuming this is a setting i have missed but I can't figure out what

June 21, 2023 at 8:08 pm
June 22, 2023 at 4:05 am #13872457

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi there,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

I see the issue happens from this page hidden link
the template to display the page in the theme folder is "page-crowd-control-weapons.php"

That means the page with the slug "crowd-control-weapons" will use this template to display content on the frontend, if not the page will display the default or another template.
The translation of this page also does not display the ACF field value until I change the slug manually to "crowd-control-weapons". Please check this screenshot hidden link

I would like to inform you that helping you with custom code, is out of the scope of WPML, but I can help you to point you to the source of the problem you are having.
I recommend contacting your developer to ask for help with this issue or one of our certified partners that will be more than happy to help you with this. In this link you will find a list of our certified partners: https://wpml.org/contractors/

Look forward to your reply.
Thanks

June 22, 2023 at 7:41 am #13873361

incloI

Hi there,

Thanks for the reply.

So just to understand the issue:

WPML does not support using custom WordPress template files to show different page layouts when using ACF?

Are there any settings that would work around this in the plugin?

Thanks,
Taryn

June 22, 2023 at 8:12 am #13873695

incloI

Sorry one more thing, changing the permalink for the child pages under crowd-control-weapons does not fix the issue.

I tried the workaround here: https://wpml.org/errata/setting-an-acf-field-to-display-based-on-parent-page-does-not-work-for-translated-posts/

This also did not work for me.

Screenshot 2023-06-22 at 9.09.24 AM.jpg
June 22, 2023 at 9:57 am #13875317

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Yes, WPML supports displaying translated ACF field values in a custom WordPress template as you can see on this page hidden link
and its translation. But I'm not sure why it does not work on the translated child page. If you can replicate the issue on a clean installation of WordPress and WPML, I will help you to check the issue.
With this link, you can login to the admin area directly hidden link

Please try to replicate the issue with minimal steps and data, don't restore the backup file there.

Thanks for your co-operation.

June 22, 2023 at 11:13 am #13875769

incloI

Hi,

I am trying to set it up in the sandbox but it there was an error when I tried to install Advanced Custom Fields Multilingual plugin. That is required to make this work right?

Thanks,
Taryn

June 23, 2023 at 3:04 am #13881499

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Yes, you should use the plugin Advanced Custom Fields Multilingual to make this work. Now I do not see any errors there.

I found an easy way to fix this issue: Just add the template name to the template file "page-crowd-control-weapons.php", instead of using the page slug template

/* Template Name: Example Template */

Then you can select the template for the page in English language, it is synced to Spanish then, please check this screenshot hidden link

Refer documentation https://developer.wordpress.org/themes/template-files-section/page-template-files/#creating-custom-page-templates-for-global-use

Look forward to your reply.
Thanks