WordPress.org

Ready to get started?Download WordPress

Forums

WPML Multilingual CMS
[resolved] Category links broken (11 posts)

  1. Soccerwidow
    Member
    Posted 3 years ago #

    After having updated to WordPress 3.1. the category links in the translated language have ceased working. Categories are now displayed as http://www.yoursite.cim/en/en/category/....

    These 2 times /en/en/ leads to 404 errors when clicking on the category.

  2. AmirHelzer
    Member
    Plugin Author

    Posted 3 years ago #

    It's a known problem with WPML 2.0.4 and is fixed in the current versions.

  3. davidtorne
    Member
    Posted 3 years ago #

    I have the same problem, What is the solution? upgrading to the paid version?

  4. AmirHelzer
    Member
    Plugin Author

    Posted 3 years ago #

    WPML 2.0.4 (which you can download from wp.org) runs fine on WordPress 3.0.5, but not on WordPress 3.1. If you look at the plugin information box, you'll see that it says "Compatible up to: 3.0.5".

    The current (paid) versions, available from WPML.org are tested and working fine with newer WordPress versions and come with guaranteed support.

  5. maryb1
    Member
    Posted 3 years ago #

    Same problem... it is duplicating the language directory in the category links. It should link to http://www.url.com/en/ but instead links to http://www.url.com/en/en/

    Is upgrading to the paid version the only solution or has someone found a way to fix it?

    Thanks!

  6. chrisdevida
    Member
    Posted 2 years ago #

    Same problem... it is duplicating the language directory in WP 3.1...

    it seems to be an intentional bug, to force WPML users to buy the commercial version. I was a long time user of WPML, willing to pay for a good service, but not that way.

    very bad behavior of the WPML folks. non acceptable!

  7. svetikkotik
    Member
    Posted 2 years ago #

    HI Everyone,
    I can't afford this upgrade so I found a "quick&dirty" solution for this bug. You do not need to edit anything but the template file 404.php (page not found) of your theme.

    I put the following lines in the beginning of the file (after <?php) :

    function curPageURL() {
    $pageURL = 'http';
    if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    } else {
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    }
    return $pageURL;
    }
    $cur_url = curPageURL();
    $repeats = array("/ru", "/it", "/es", "/de", "/fr");
    foreach($repeats as $repeat){
    if(strstr( $cur_url, $repeat.$repeat.'/' )){
    $cur_url = str_replace($repeat.$repeat.'/', $repeat.'/', $cur_url);
    header( 'Location: '.$cur_url ) ;
    }
    }

    What is does is to remove the superfluous part from the URL and reload the correct URL. You should list all your additional language domains as values in $repeats (in my case, these are 5 languages).
    I am sure there are more elegant solutions, but I am not a guru and this one at least works and does not let this "intentional bug" ruin your blog. Feel free to contact me if you need help adjusting this solution to your case.
    Svetlana

  8. Soccerwidow
    Member
    Posted 2 years ago #

    Hello svetikkotik,

    Thank you for the offered solution. However, unfortunately it didn't work for me, but I had a bright idea this morning...

    I downloaded the WordPress plugin for redirection: http://wordpress.org/extend/plugins/redirection/ and have now redirected all faulty categories to the correct ones. Simple, isn't it? Took me only 4 months to think of this!

    Luckily I don't have too many categories, therefore it was just half an hour to get my blog sorted. Now it's up and running as smoothly as it should have been all along.

  9. artlosk
    Member
    Posted 2 years ago #

    Fix this problem. Open file "sitepress.class.php" in plugin "sitepress-multilingual-cms".

    Find line 3406

    if($this->get_default_language() != $element_lang_details->language_code){
    $p = $this->convert_url($p, $element_lang_details->language_code);
    }

    and comment this line.

  10. botiko
    Member
    Posted 2 years ago #

    Thank you artlosk!!
    Your solution is great and it totally fixes the problem with the category links. I've been trying (with 'tax_permalink_filter' and so on) but i can't find the solution with the tag links. Do you know how to fix this one?
    Thanks again

  11. monavie1989
    Member
    Posted 2 years ago #

    My solution Fix problem with tags!
    Open file ""sitepress.class.php" in plugin "sitepress-multilingual-cms".
    find line "function convert_url($url, $code=null)" (Find line 3311)
    Replace code in function "function convert_url($url, $code=null)" follow function code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic