• Auror

    (@auror)


    Hello,

    The language switcher won’t work on some author pages. Instead of retrieving that user’s translated author page, it redirects to the homepage.

    I am using /%postname%/ as permalink structure.

    Is anyone familiar with this?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    Hi,

    This is the intended behavior if the author has not written any content in the translated language. The language switcher does not link to empty pages.

    Thread Starter Auror

    (@auror)

    Thanks for your prompt answer. I see! Would you be so kind as to point me to which parts of the code I should edit to change this? Again, much appreciated.

    Thread Starter Auror

    (@auror)

    Hi again! It seems to me a bit weird that authors will show in the default language regardless of whether they have posts, but only show in other languages if they do. So I poked around and came up with the following edits to address this. It seems to be working fine, so I thought I’d share in case there are more people interested. Please do let me know if I got something wrong.

    in frontend/frontendlinks.php, look for:

    
    // Other archives
    			elseif ( is_archive() ) {
    

    replace with:

    
    // Author archive
    			elseif (is_author() ) {
    				$url = $this->get_archive_url( $language );
    			}
    
    			// Other archives
    			elseif ( is_archive() && ! is_author() ) {
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘switcher malfunctioning in author pages’ is closed to new replies.