Skip Navigation

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

Problem:
The client created a translation of a 'my courses' page using the [ou-courses] shortcode to display courses the user is enrolled in. However, the translated page displayed a message indicating no enrolled courses were found, likely because it was trying to retrieve only translated courses.
Solution:
We recommended setting the post type 'Courses' to 'Translatable - use translation if available, or fallback to default language' in WPML > Settings > Post Type Translation. This configuration allows the display of the original course in the second language if they have not been translated. For more details, visit Displaying Untranslated Content on Pages in Secondary Languages.

If this solution does not apply to your case, or if it seems outdated, 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 issues persist, please open a new support ticket.

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 1 voice.

Last updated by cimpleA 4 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 6, 2025 at 10:07 am #16781149

cimpleA

Background of the issue:
I have created a translation of a 'my courses' page where the shortcode [ou-courses] (hidden link) is used to display all the courses that the user is enrolled in. We will not be translating our courses, as we have unique courses created in different languages already. These are xAPI files, not made directly in LearnDash.

Symptoms:
When viewing the translated page, it just displays a string 'Sorry! You don’t have any enrolled Courses.' From what I understand, it is trying to retrieve only courses that have been translated.

Questions:
Is it possible to make the [ou-courses] shortcode return all courses that the user is enrolled in, without taking into account any translations?

March 6, 2025 at 2:09 pm #16783884

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hello,

Please go to WPML > Settings > Post Type Translation and set the post type "Courses" to "Translatable - use translation if available, or fallback to default language."

This should display the original course in the second language as long they have not been translated.

Guide:
https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

Best regards
Andreas

March 6, 2025 at 2:26 pm #16783977

cimpleA

Hi Andreas,

Thank you for the information. While this seem like a good solution, it does not make any change to the translated page. I made sure to clear all caches etc, and also tried the "Not translatable" option.

Any other suggestions?

Regards,
Mattias

March 7, 2025 at 9:45 am #16787213

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support, I'm assigned this ticket and 'll try my best to help you on the matter.

Before proceeding further, is it possible for you to check in a minimal environment? Like with only WPML plugins, Learndash and a default theme?

IMPORTANT: Please take full backup of your website and database beforehand. 

It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.

So we can then rule out any possibility for a conflict caused by any other plugin, theme or a process.

Please let me know and I'll try my best to help you further.

Regards.

March 7, 2025 at 9:53 am #16787246

cimpleA

Hi,

While I agree that this would be a good way to start out the troubleshoot, I'm not currently able to provide a minimal environment. I just created a staging environment as a copy of our site, but this is currently being used in another support ticket with WPML (https://wpml.org/forums/topic/login-redirect/#post-16783879).

Are you able to share the staging site with the provided credentials that has been given in ticket #post-16783879?

Regards,
Mattias

March 7, 2025 at 12:25 pm #16788306

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I see that the other ticket is assigned to my colleague and they are working on it. So I think its not a good idea for me to login at the same time and do that debugging stuff.

I'll recommend waiting for the other ticket to complete and let me know when it is OK to work on the same site.

March 7, 2025 at 1:23 pm #16788527

cimpleA

That sounds like a good plan, I'll let you know here when the other ticket is done, so we can continue.

March 10, 2025 at 7:15 am #16794547

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sure, please take your time and feel free to reply when it is ready, thanks.

March 10, 2025 at 12:58 pm #16796593

cimpleA

Hi,

The other case is now finished. It turns out that the login shortcode we are using isn't compatible with the language URL format (/no/) but works with the format ?lang=no. As a workaround, we decided not to create a translation of the login and logged-in pages and instead redirect users to the original language version in the translated menu.

In other words, we will not be using the translated "My Courses" page for now, so this issue is no longer relevant to us. However, if we revisit this in the future, it would be helpful to have a solution for this ready.

I noticed something important: If a user is enrolled in a group that has courses assigned to it, the translated version of "My Courses" isn't able to display them. However, if a user is enrolled in the courses directly, they are able to see them in the translated version of "My Courses."

So, it seems to me that the root cause is linked to this difference. It might be worth investigating further. Feel free to use the login credentials for the staging site to experiment. Let me know if the credentials are unavailable in the other support ticket, and I’ll add them here as well.

Regards,
Mattias

March 10, 2025 at 2:03 pm #16796927

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates. That may be related however I can check for more details.

The access information on the other ticket has been removed automatically because the ticket was closed as resolved.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

P.S.: If you don't see the section for providing access information, do not write in the message box or the information may appear as public.

March 11, 2025 at 6:45 am #16799481

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access but unfortunately I'm not able to login and getting an error saying "Invalid username and/or password". I simply copy/pasted the credentials you provided.

Please check on your side and let me know.

I've enabled your next reply as private again, in case if you want provide different/updated credentials.

Screenshot 2025-03-11 114346.jpg
March 11, 2025 at 1:20 pm #16801940

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates, I 'll check soon and 'll get back to you as soon as I find something or have a solution.

March 12, 2025 at 9:00 am #16805769

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. I was able to login and check for the said issue. However, I'm having a little difficulty understanding the following:

If a user is enrolled in a group that has courses assigned to it, the translated version of "My Courses" isn't able to display them. However, if a user is enrolled in the courses directly, they are able to see them in the translated version of "My Courses."

Can you please provide the steps about how to reproduce or check this?

March 13, 2025 at 5:15 am #16809758

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Yes I can see the course listed for both users in both languages. And the changes in URL handling has perhaps flushed links caches and may have repaired the internal linking.

However, since issue no longer exists, please feel free to close this ticket. You can open a new one anytime if you run into the same or another problem again.

P.S.: I've set your previous reply as private because the credentials were public.

March 13, 2025 at 7:37 am #16810058

cimpleA

Great, yes you are probably right about that.

Thanks for the support on this 🙂