Skip Navigation

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

Problem:
The client reported that a French blog post was incorrectly displaying on an English page on their website, despite both versions appearing identical in the WP admin and front end. Additionally, there was an odd layout and error message at the bottom of the post.
Solution:
We discovered that the issue stemmed from the query used in the template file for the 'Related News' section, which lacked a language filter. To resolve this, we added the

'suppress_filters' => false

argument to the query, ensuring that only posts corresponding to the current language are displayed. This adjustment fixed the display issue on the English 'Aerospace' page.
For the error on the French News page, it was caused by a problem with how the contributor images were saved in the translation. We corrected this by opening and updating each contributor's profile in the French version without making any changes, which resolved the layout and error message.

If you're experiencing similar issues, we recommend checking your queries to ensure they include appropriate language filters and verifying that all content elements are correctly saved in their respective translations. If these steps do not resolve the issue or if the solution seems outdated or irrelevant to your case, please visit our support forum to open a new support ticket. Additionally, 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.

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.

Our next available supporter will start replying to tickets in about 1.37 hours from now. Thank you for your understanding.

This topic contains 9 replies, has 2 voices.

Last updated by Prosenjit Barman 2 months, 2 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
June 19, 2024 at 7:50 pm #15758364

Chad Warner

Background of the issue:
I am working on hidden link. On the page hidden link, a blog post appears in both English and French in the 'Related News & Insights' slider. In that slider, the French post has the same URL as the English post, even though it should be hidden link. This issue is not present on the staging site (hidden link). In both sites, the post looks the same in WP admin and on the front end, including the odd layout and error message. The Aerospace market is the only market without a French translation, but this is also the case on the staging site where the problem does not occur. 'Market' is a custom post type (CPT).

Symptoms:
The French blog post is displaying on the English page. The post has an odd layout and error message.

Questions:
Why is the French blog post showing on the English page?
Could the lack of a French translation for the Aerospace market be causing this issue?
What could be causing the error message at the bottom of the post?

June 21, 2024 at 6:12 am #15771209

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thanks for contacting WPML Support.

I understand the issue you're having. Upon checking the WPML debug info, I noticed that the translation preference for "Posts" is set to "Translatable - use translation if available or fallback to default language." This means the default post will appear as a fallback in the other language. This preference could be causing the issue with your posts.

Please try the following and check if that helps in solving the issue with posts:

- Please go to "WPML > Settings" and scroll to the "Post type Translation" section.
- Change the settings for 'Post', 'Pages' and 'market' to "Translatable - only show translated items"
- Clear the caches from your site and browser and check the default Aerospace post.

Regarding the layout issue in the French post, there seems to be a fatal error that is causing the layout to appear broken. Enabling the WordPress debug log will provide more details about the exact cause of the fatal error. Please refer to this guide to understand the process of enabling debug mode.

Once the debug log is enabled, refresh the French post and check if you see any logs in the debug file or frontend. If you notice any, please copy them and share them in your next response so that we can understand the root cause of the issue.

Additionally, you can perform a conflict test on your site. To do this, deactivate all plugins except for WPML and its addons, and then refresh the French post. If this resolves the issue, start reactivating the plugins one by one. After activating each plugin, refresh the French post. In this way, you'll be able to detect what exactly is causing the issue.

Let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

June 21, 2024 at 2:33 pm #15776176

Chad Warner

Thank you. Changing the settings for 'Post', 'Pages' and 'Market' to "Translatable - only show translated items" didn't fix the problem. Also, the staging copy of the site is set to "Translatable - use translation if available or fallback to default language," and it doesn't have this problem (hidden link).

I enabled debug on the staging site. The post shows debug info at the top and bottom, in English (hidden link) and French (hidden link).

On the staging site, I deactivated all plugins except WPML and its addons, and Advanced Custom Fields PRO and Advanced Custom Fields Extended PRO (because pages are built using ACF). The French post still had an odd layout on the staging site. The layout of the English translation was fine. I can't deactivate plugins on the live site.

June 24, 2024 at 7:15 am #15803695

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well. Sorry for the delay in responding due to the weekend.

I tried to access the Staging site but since the Browser authentication is enabled, I can't proceed without entering a username or password.

However, as the issue with incorrect posts and layout persists in the production site, a closer inspection will be required to understand the root cause of the issue.

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.

You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please backup site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Looking forward to your response.

Best Regards,
Prosenjit

June 25, 2024 at 12:50 pm #15820867

Chad Warner

I'm waiting for the site owner to grant permission to give access.

June 27, 2024 at 3:04 am #15839175

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

Sure, no problem. Once you receive the necessary permission, please take a full backup of the site and database and then share the access with us. I have enabled the private box for you to share the access details securely.

Looking forward to your response.

Best regards.
Prosenjit

June 28, 2024 at 11:20 am #15851408

Chad Warner

I'm still waiting for the site owner to grant permission to give access. Please don't close this ticket.

July 1, 2024 at 1:20 pm #15868826

Chad Warner

I'm still waiting for the site owner to grant permission to give access. In the meantime, please don't close this ticket.

July 2, 2024 at 3:01 am #15871667

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for the updates.

Please share the access information as soon as you receive it from the client. The private box is enabled for you to securely share the access details.

Please note that the ticket may close after 7-10 days of inactivity. If this happens, feel free to create a new ticket and include a link to this one as a reference so we can continue where we left off.

Looking forward to your response.

Best regards,
Prosenjit

July 4, 2024 at 4:35 am #15888600

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for sharing the access information.

I've checked and included my findings and solution for both the issues you reported, below.

- French posts were showing up in the English version: Upon checking the template file for the Related News section, I noticed that the filter to display posts in each language hadn't been added to the query. As a result, posts from all languages started to appear in the Related News section. To fix this, I added the `'suppress_filters' => false` argument to the query (Screenshot: hidden link), which filters the posts by language. This resolved the issue on the English 'Aerospace' page, and now only English posts are being displayed in the related news section. Please check this screenshot: hidden link

- Error on the French News page: As there was a sign of a Fatal error, I enabled the debug log to investigate. The error was due to the contributor image not being saved correctly in the translation. To resolve this, I opened each contributor's profile in the French version and saved the content without making any changes. After doing this, the news page displayed correctly. You can check the full-page screenshot here: hidden link (Scroll over the image).

If the issue occurs on any other news page, please open each contributor attached to the specific news in the French version and click Update without making any changes (Screenshot: hidden link). The issue will be resolved after that.

I hope I was able to help you resolve the issues. If you need further assistance, feel free to let me know. I'm always happy to help.

Best regards,
Prosenjit

Chad Warner confirmed that the issue was resolved on 2024-07-10 14:19:30.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.