WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher
[resolved] Error showing the main site link (14 posts)

  1. darkpollo
    Member
    Posted 1 year ago #

    Hi,

    I have installed the plugin and everything works fin except for the main website link.

    WordPress is installed under a subfolder so the plugin thinks that the subfolder is the main website, when it is on the domain.com

    installatiom folder: http://www.domain.com/wp
    Main website: http://www.domain.com
    Other websites on multisite:
    http://www.domain.com/en
    http://www.domain.com/ch

    etc

    Can you fix it?

    Thanks

    http://wordpress.org/extend/plugins/multisite-language-switcher/

  2. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, let me know if my developer-version is solving your problem:

    https://github.com/lloc/Multisite-Language-Switcher

  3. AdrianB
    Member
    Posted 1 year ago #

    I think I have the same problem. It seems like Multisite Language Switcher is using the WordPress address instead of the Site address for the main site. I tried the dev version from github but the result was the same.

    I have two sites:
    Main: http://example1.com
    Second: http://example2.com

    The Multisite Language Switcher link from main to second works:
    http://example1.com -> http://example2.com
    But not from second to main:
    http://example2.com -> http://example1.com/wordpress

    I have WordPress in a sub directory like this on my main site setup like this:
    WordPress address (URL): http://example1.com/wordpress
    Site address (URL): http://example1.com

  4. AdrianB
    Member
    Posted 1 year ago #

    I tried to change site_url() to home_url() in the get_permalink() function in MslsOptions.php but that did not work for some reason.

  5. darkpollo
    Member
    Posted 1 year ago #

    Hi, Sorry for the late reply.
    I will be able to test it on the weekend.

    As i have only two sites, I found a workaround using the <?php is_front_page(); ?> to show a manual url on the home and use the plugin on the others.

    http://codex.wordpress.org/Function_Reference/is_front_page

    This is only temporary, but it works.

    I will wait for a new version that fix the problem.

    Thanks

  6. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    @AdrianB Please have a look at the indicated version first. There is no call to site_url().

    @darkpollo OK, let me know when you have some news redarding this issue.

  7. AdrianB
    Member
    Posted 1 year ago #

    I se now that it is home_url() that is used here:
    https://github.com/lloc/Multisite-Language-Switcher/blob/master/includes/MslsOptions.php

    I was changing the current stable version when I was experimenting. But nonetheless the first thing I tried was using the dev version and that didn't work, it was after that I tried to modify the stable version by switching to home_url() just like you already have done in the dev version.

    I tried again just now and swapped only the MslsOptions.php to the latest dev version and still get /wordpress in my link. home_url() shouldn't be doing that (and it doesn't if I put in in my theme) so I don't know what is going on.

  8. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    Do you have installed a domainmapper? How is your setup?

  9. AdrianB
    Member
    Posted 1 year ago #

    Yes I'm using the "WordPress MU Domain Mapping" plugin.

    My Domain Mapping Configuration is a Server IP Address and the other settings are:

    Checked: "Remote Login"
    Unchecked: "Permanent redirect (better for your blogger's pagerank)"
    Checked: "User domain mapping page"
    Checked: "Redirect administration pages to site's original domain (remote login disabled if this redirect is disabled)"
    Unchecked: "Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues."

    (If that was the setting you where looking for.)

  10. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    I have checked "Permanent redirect" (but I never checked what it does).

    In "Settings > Domains": All your domains are primary domains?

    Your blogs are as subdomains or as subdirectories installed?

  11. AdrianB
    Member
    Posted 1 year ago #

    I tried checking "Permanent redirect" but it did not make any difference in my case as far as I can see.

    I have only one domain ("example2.com") under "Settings > Domains" and it's primary.

    My sites are subdomains (that is the only way if you wan't to use different top level domains like I do, I think).

  12. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    Maybe in your case there should be a check if it's the primary site (there is a define in wp-config.php) and if this is true a call to network_home_url() instead of home_url().

  13. darkpollo
    Member
    Posted 1 year ago #

    Hi,

    I have tested this with the latest development version and it works as expected.

    Thanks!

  14. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    OK. Very good!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.