Skip Navigation

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

Problem:
You are trying to apply template conditions in the Bricks Theme to display only for specific terms, such as a particular category, but the condition does not apply correctly in the translated templates. This issue occurs with a template for a custom post type post.
Solution:
If you're experiencing this issue, we recommend you try the following steps:
1. Go to WPML-> Settings-> Custom Fields Translation section
2. Click "Show System Fields"
3. Search for the "_bricks_template_settings" field
4. Set as Copy Once and save
5. Edit the template in the default language
6. Make a minor edit and update it
7. Switch the language using the top admin bar
8. Edit the translated template using Bricks
9. Edit the translated template display conditions
10. Select the translated term and save it
We tried these steps on the Asia template, which resolved the issue in this language. Please try the steps from Step 7 in other languages and let us know if that fixes the issue.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. 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 at WPML support forum.

0% of people find this useful.

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

Last updated by pavlinaD 1 month ago.

Assisted by: Osama Mersal.

Author Posts
January 13, 2025 at 10:23 am

pavlinaD

Background of the issue:
I am trying to apply template conditions in the Bricks Theme to display only for specific terms, such as a particular category, but the condition does not apply correctly in the translated templates. I am experiencing this issue with a template for a custom post type post. I have implemented the workaround suggested here: https://wpml.org/errata/bricks-theme-template-conditions-not-applied-correctly-in-translated-templates/comment-page-1/?unapproved=9065985&moderation-hash=9f2364b11a4be5f815395cc531d02e51. I also tried translating the template using the WordPress editor and resaving settings and translations after the change but this didn’t resolve the issue. The design created with a single template in the English version is not applied across translations, as seen in the example where it doesn’t work: hidden link.

Symptoms:
The template condition does not apply correctly in the translated templates. The design created with a single template in the English version is not applied across translations.

Questions:
Is there something else I can try to resolve the issue with template conditions not applying correctly in translated templates?

January 13, 2025 at 11:18 am
January 14, 2025 at 12:41 pm #16592925

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

Please log in to this hidden link">sandbox site and install Bricks. After that, please create a test template and translate it to replicate the issue.

If the issue is replicable, please let me know how to reproduce it to consult our compatibility team.

Best regards,
Osama

January 14, 2025 at 1:37 pm #16593285

pavlinaD

Hi,

Thank you for the fast response.

I would gladly follow the steps you suggested but unfortunately we only have one license for Bricks that we need for our website so I won't be able to install it on your sandbox site.

The issue is already visible on the staging website I provided credentials for (if you don't see them in this ticket, let me know and I'll send them immediately).
You can see the issue by checking the single case study template in wp-admin -> Bricks -> Templates -> Single Post Template – Case Studies.
Its conditions are set to display the template for all posts from the post type Library in the term Case Studies. It's assigned correctly but the design is applied only for the main (US) version. All other languages don't follow that design.
Here is an example: hidden link (US) and hidden link (Asia).

Would this information be enough for you to troubleshoot?

Thank you.

January 14, 2025 at 1:58 pm #16593326

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your update. I checked the issue on your staging site and tried a workaround with no luck.

I installed and activated the Bricks theme on the sandbox site. Could you replicate the issue?

Thanks for your cooperation

Best regards,
Osama

January 16, 2025 at 9:07 am #16600441

pavlinaD

Hi,

I answered yesterday but it seems it wasn't posted.

Unfortunately, despite my efforts to replicate the setup on your site, there are many other plugins and settings that are needed to do so and I can't seem to implement it.

However, I did notice something that I believe might be the cause. The way the template works when synced between languages is that it uses the category ID in template conditions. That ID should remain the same for all languages for it to work.

On the main language, the term was added manually and is Case studies (Library Categories) with ID 4. This value in the other language templates is library-category::4. However, this term ID isn't the same for the other language versions. The Case studies term has been translated using WPML translation and from the category panel, so they are linked.
Is the default WPML behavior to have different IDs for translated terms?

If it's possible to have the same ID for the case studies term across languages I belive the issue would be fixed.

Having this information, do you have any solutions in mind?

Thank you and best regards.

January 16, 2025 at 9:27 am #16600643

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your reply. Having the same ID for terms in different languages is not possible because WordPress treats them as different terms.

WPML links them to tell WordPress they are in different languages but can't have the same ID.

I think I found a workaround for this issue. Please check if this post works correctly. (hidden link)

Best regards,
Osama

January 16, 2025 at 11:38 am #16601726

pavlinaD

Hi again,

Thank you for the explanation.

I checked this post and indeed the design is as per the template and as expected.
Perhaps the change you implemented is only applied to the post you shared but I just wanted to let you know that all other language versions of it aside from Asia & US aren't fixed, as well as all other posts.

Could you please let me know what you did so that I can try to implement it for all versions and posts?

Best regards

January 16, 2025 at 11:53 am #16601779

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please check the following steps:

1- Go to WPML-> Settings-> Custom Fields Translation section
2- Click "Show System Fields"
3- Search for the "_bricks_template_settings" field
4- Set as Copy Once and save
5- Edit the template in the default language
6- Make a minor edit and update it
6- Switch the language using the top admin bar
7- Edit the translated template using Bricks
8- Edit the translated template display conditions
9- Select the translated term and save it

I tried the above steps on the Asia template, which fixed the issue in this language. Please try the steps from Step 7 in other languages and let me know if that fixes the issue.

Best regards,
Osama

2025-01-16_13-52-16.png
January 17, 2025 at 7:03 am #16604459

pavlinaD

Hi,

Thank you for all the help, the issue has been resolved!