Skip Navigation

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.

Author Posts
September 19, 2016 at 7:35 pm #1088232


I am trying to:
Visit my Author URL without the default language in the URL.

URL of (my) website where problem appears:
Available privately upon request.

I expected to see:
In English, which is set as a secondary language, this works fine, but not in French, which is my primary language.

English URL: /en/author/myname/
French URL: /author/myname/ (or even better /auteur/myname/)

Instead, I got:
Instead, the French URL is: /fr/author/myname/

Steps to duplicate the issue:
Using WordPress 4.6.1 and WPML, I set "Langues différentes dans les répertoires ((hidden link - Français, hidden link - Anglais))". I DO NOT check Utiliser le répertoire pour la langue par défaut.

Visiting the home page works fine WITHOUT the /fr/ in French and and WITH the /en/ in English. This is the desired behaviour.

If I use the following code in the blog, I get the /author/myname/ in French, but the URL is a 404. The real URL is /fr/author/myname/

<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>

September 20, 2016 at 5:11 pm #1090572



If possible can you please elaborate a little more.
Which permalink structure are you using?
Can you please try to re-save your permalink structure?


September 20, 2016 at 5:14 pm #1090588



Sorry it was marked as resolved by mistake

September 20, 2016 at 6:48 pm #1090780


Ah, I finally found the problem - a previous programmer added in an action on the 'rewrite_rules_array', 'wp_loaded', 'post_link', 'post_type_link', 'page_link', 'term_link' and 'get_comment_link' a long time ago buried deep in the theme to make his own version of WPML's "use directory for default language". I just commented out those actions and voilà! Everything is working perfectly now.