Skip Navigation

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

Problem:
The client was experiencing an issue where posts in the main language were visible on the translated version of the site.
Solution:
We noticed that the custom theme code was missing the suppress_filters=0 argument. We recommended adding this argument to the WP_Query or get_posts arguments to ensure proper filtering of translated content. Here's the step-by-step solution:
1. Open the front-page.php file.
2. Around line 25, modify the arguments array to include 'suppress_filters' => 0.
The modified code should look like this:

// Loop arguments
$args = array(
    'post_type'         => 'post',
    'posts_per_page'    => $posts_per_page,
    'offset'            => $offset,
    'suppress_filters'  => 0,
);

We also reminded the client that custom code and themes are not covered by our support policy, but we provided assistance to help get them started. For further information on the suppress_filters argument, we directed the client to our documentation on debugging theme compatibility.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If the issue persists, 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 you need further assistance, please open a new support ticket in our support forum.

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

Last updated by Nicolas V. 1 year, 1 month ago.

Assisted by: Nicolas V..

Author Posts
April 30, 2024 at 12:42 pm #15581326

zachariasD

Hello, I am trying to add translations. But all my posts in the main language are visible on the translated version of the site

April 30, 2024 at 1:55 pm #15581584

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

As discussed, I have activated a private field for your next answer where you can provide that credentials to the staging copy safely (this field is only visible by you and the support team). Don't share your own admin account, create a new one that you will delete when we finish troubleshooting.

IMPORTANT: Before we proceed, please backup your site and database.

May 2, 2024 at 11:53 am #15586949

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Sorry for the late reply, yesterday was a public holiday. I checked your custom theme code and noticed that you didn't add suppress_filters=0 to your arguments.

If you use wp_query($args) or get_posts($args) you need to add “suppress_filters=0” to arguments.

I added it to your arguments and it seems to work properly.

- Open front-page.php and around line 25

// Loop arguements
$args = array(
    'post_type'         => 'post',
    'posts_per_page'    => $posts_per_page,
    'offset'            => $offset,
    'suppress_filters'  => 0,
);

Could you please confirm that the issue is solved now?

Also please note that custom code and themes are not supported as mentioned in our support policy. But I still wanted to help you out and get you started. If you enconter other issues, please have a look to this documentation where the suppress_filters is mentioned: https://wpml.org/documentation/support/debugging-theme-compatibility/

May 2, 2024 at 12:51 pm #15587302

zachariasD

Amazing,

I am going to try it on the live site. I am in filemanager but cant find the front-page.php. where is it located? 🙂

May 2, 2024 at 1:03 pm #15587361

zachariasD

Found it, and I think it is working!!!! FINALLY

You seem to be jesus on this stuff 😉

May 2, 2024 at 7:05 pm #15588873

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

I'm glad we found a solution. Please feel free to open a new ticket anytime you have questions, we will be happy to help.

Have a good day ahead, Bye 🙂