Skip Navigation

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

Problem:
The client has a Dutch website and is translating it into English. They have a custom post type named "medewerkersverhalen" and a shortcode to display these stories. However, when translating an employee story, the English overview page also shows the Dutch stories, which is not intended.
Solution:
We recommend setting the custom post type to be translatable and to show only translated items. To do this, navigate to WPML -> Settings and set the post type "medewerkersverhalen" to "Translatable - Show only Translated Items".

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If the issue persists, we encourage you to open a new support ticket. We also 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 further assistance is needed, please contact us in the WPML 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 3 replies, has 3 voices.

Last updated by Osama Mersal 9 months ago.

Assisted by: Osama Mersal.

Author Posts
May 13, 2024 at 12:46 pm #15620994

cornelisS

Hello. I have a website hidden link. It's originally a dutch website, but now i'm translating it to English. I have customposttype named "medewerkersverhalen" and a shortcode to show them, but when I try to translate a employee story it works but it also show the dutch employee stories on the English overview page. Which is not supposed to happend

May 13, 2024 at 1:10 pm #15621093

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

This ticket has been inactive for quite a while. I didn't get a reply from you. So, I've transformed this chat into a support ticket because you may still need our help. If you do, please reply to this ticket, and one of our supporters will continue helping you.

Please answer the following questions.

1. How did you create this custom post type?
2. Where can we see this problem on your site?

Screenshots will be much appreciated.

Regards,
Itamar.

May 13, 2024 at 2:22 pm #15621357

cornelisS

Hello,

1. The code below is the code I used to create the custom post type
function pf_create_medewerkersverhalen_posttype() {
register_post_type( 'Medewerkersverhalen',
// CPT Options
array(
'labels' => array(
'name' => __( 'Medewerkersverhalen' ),
'singular_name' => __( 'Medewerkersverhaal' )
),
'rewrite' => array( 'slug' => 'medewerkersverhalen', 'with_front' => false ),
'public' => true,
'has_archive' => false,
'supports' => array('title', 'editor', 'revisions', 'excerpt', 'thumbnail'),
'menu_icon' => 'dashicons-format-quote',
'show_in_rest' => true, // gutenberg
)
);
}

2. You can view the problem via this link hidden link

In the screenshots I shared you can see that in the backend I only have 1 published Employee story. But in the second screenshot you can see more than 1 published story.

Schermafbeelding 2024-05-13 om 16.18.16.jpg
Schermafbeelding 2024-05-13 om 16.18.37.jpg
May 13, 2024 at 2:55 pm #15621531

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 go to WPML-> Settings and set the post type to "Translatable - Show only Translated Items".

If that didn't help, please let me know how you loop over the posts to create this section.

Best regards,
Osama