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.

This topic contains 1 reply, has 2 voices.

Last updated by Radu 1 month ago.

Assigned support staff: Radu.

Author Posts
September 9, 2019 at 6:46 pm #4539779

pinalD

We're trying to use do_action( 'wpml_switch_language', 'all' ); // switch the content language to show all posts.

The problem is some of our posts are translated, and this is showing both the translated post as well as the native language post. Is there a way to show all posts but if it's translated to JA then we would remove the EN version?

September 10, 2019 at 6:08 am #4542083

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey,

Thank you for reaching out the WPML support!

Although the custom coding is outside of our support scope, I can try to give you some advice about what might be doing the trick for your request.

I think that you can use the wpml_object_id hook (https://wpml.org/wpml-hook/wpml_object_id/) in order to check if the current post has a JA translation.

In this case, you'll need to create an if statement to use all for the wpml_switch_language hook if there's a JA translation or en if not. You can try this out.

Thanks,
Radu

The topic ‘[Closed] Removing duplicates from showing all translated posts’ is closed to new replies.