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.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| - | - | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 |
| - | - | - | - | - | - | - |
Supporter timezone: America/Lima (GMT-05:00)
Tagged: Custom Work, Exception
This topic contains 11 replies, has 1 voice.
Last updated by Andreas W. 6 days, 15 hours ago.
Assisted by: Andreas W..
| Author | Posts |
|---|---|
| October 22, 2025 at 4:33 pm #17509219 | |
|
josephN-9 |
Background of the issue: Symptoms: Questions: |
| October 23, 2025 at 7:58 am #17511238 | |
|
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello, Thanks for contacting us. While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly. Make sure post exist for that language for that author, if there is no post in EN then WordPress does not create author page. In short, make sure you have translated posts from this author to other languages also. Regards, |
| October 24, 2025 at 4:25 am #17514453 | |
|
josephN-9 |
But it seems it is not like that as you explained: hidden link hidden link So I meant it should works as usual, if user has article then shows as usual: if not has any article it should show like that "Oops! Nothing here"- hidden link But another issue is- If you first visit ar - hidden link but if you first visit eng: hidden link it not allow to go arabic from header language dropdown: why ? |
| October 24, 2025 at 10:35 pm #17517951 | |
|
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Thank you for the provided details! The redirect works from This page does not yet have any posts: I suggest you first translate the posts and then test again. If you still run into language switcher redirect issues after all posts have been published in all languages, we can take further steps from there. Best regards |
| October 25, 2025 at 3:42 am #17518086 | |
|
josephN-9 |
Hlw andreas, I just wanted to ensure if user doesn't have any posts, It should show like that: "Opps nothing here...." My question is- why it not works for other language ? hidden link I have many user who has only english article and will not have translated of them. and I manage my business like that if they want to translate they need to pay so most of the client has on language posts |
| October 25, 2025 at 7:33 pm #17518884 | |
|
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, I created a test site using the Twenty Twenty-One Theme and WPML, and I can not confirm this issue. In my example, the site's default language is English, and I have one post in German. If I revise the author page in German, I see one post as expected, and there is no language switcher option, as the English author page has no posts: This means, on your site, it is unexpected that the WPML languages switcher offers a language option if the translated author page has no posts. My test page: Now, the unexpected behavior on your site could be caused by the theme or by custom code used in your child theme. Could you please install the latest version of the Foxiz Theme on the following test site, so that we can test if this issue if theme-related? One-Click-Login: Leave me a comment on this ticket once you are done with this task. Best regards |
| October 26, 2025 at 4:04 am #17519039 | |
|
josephN-9 |
I'm using latest Foxiz theme and relevant plugin. I have few custom code on child theme and wp code plugin but they are not even related to wpml . Even I have tested by remove my child theme code and decativate custom code plugin. Please keep in mind, I have enabled this option: may be that's why It redirect home page if user doesn't exist any posts but it should work for all user. my concern is here : or Shouldn't generate author page who doesn't have any posts. but here behaves unusual: if user doesn't have any posts, It should show like that: "Opps nothing here...." Below they are redirected to homepage hidden link I have tested your demo site |
| October 26, 2025 at 4:48 am #17519065 | |
|
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Would it be possible for you to install the latest version of the Foxiz Theme on my sandbox, so that we can try to replicate the issue there and then take further steps? One-Click-Login: If this is not possible, I can offer to take a closer look at your site as an admin user. You can find the required fields below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it. IMPORTANT I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further. However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose. If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/account/websites/. If you are unable to provide such a copy of the website for testing, please let me know on this ticket. The private reply form looks like this: Click "I still need assistance" the next time you reply. Video: Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket in the private response form. |
| October 27, 2025 at 5:56 pm #17523260 | |
|
josephN-9 |
Hello Andreas I have sent all credentials to you, Could you check my issue ? |
| October 28, 2025 at 9:39 am #17525276 | |
|
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
My apologies for the delay in answering. As I mentioned earlier, on my test site, WPML will not display language options inside the language switcher if an author page has no posts. In your case, you see a language option, as at WPML > Settings > Post Types Translation, the type "Posts" is set to "Translatable use translation if available or fallback to default language". Your example author only has one post in Arabic: If I now use the language switcher on this page to switch to another language, I will always land on the respective homepage. This is expected as long as the archive has no posts. You can use this hook to solve this issue: Example for placing into your Code Snippets plugin:
add_filter( 'icl_ls_languages', 'wpml_author_switcher_fix', 10, 1 );
function wpml_author_switcher_fix( $languages ) {
if ( is_author() ) {
$author = get_queried_object();
$author_slug = $author->user_nicename;
foreach ( $languages as $lang_code => &$lang ) {
// Build the correct URL using the current domain and language slug
$lang['url'] = '/' . $lang_code . '/author/' . $author_slug . '/';
}
}
return $languages;
}
What This Does - Forces each language switcher link to resolve to the author archive, even if no posts exist in that language. - Prevents redirection to the homepage (which happens when WPML suppresses empty archives). |
| October 28, 2025 at 5:34 pm #17527281 | |
|
josephN-9 |
Hello andreas, still need a small help: and now I want to switch english by languge switcher, it gets this link : but it should get exactly below since my default language is "english" : means without /en/ with /en/ it gets 404 page error. |
| October 29, 2025 at 5:09 am #17527886 | |
|
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Absolutely, sorry about that! Please try this:
add_filter( 'icl_ls_languages', 'wpml_author_switcher_fix', 10, 1 );
function wpml_author_switcher_fix( $languages ) {
if ( is_author() ) {
$author = get_queried_object();
$author_slug = $author->user_nicename;
$default_lang = apply_filters( 'wpml_default_language', null );
foreach ( $languages as $lang_code => &$lang ) {
if ( $lang_code === $default_lang ) {
// No language prefix for default language
$lang['url'] = '/author/' . $author_slug . '/';
} else {
$lang['url'] = '/' . $lang_code . '/author/' . $author_slug . '/';
}
}
}
return $languages;
}
|
