WordPress.org

Ready to get started?Download WordPress

Forums

qTranslate slug with widget
[resolved] Problem with (5 posts)

  1. baga
    Member
    Posted 2 years ago #

    Hello I noticed a problem with the tag <link rel="alternate", for example I have this page, in English and Italian:

    mysite.com/page-one/
    mysite.com/it/pagina-uno/

    The alternate link for the Italian page on the English version is:

    <link hreflang="it" href="http://mysite.com/it/page-one" rel="alternate" rev="alternate" />

    The correct tag should be:

    <link hreflang="it" href="http://mysite.com/it/pagina-uno" rel="alternate" rev="alternate" />

    Anyone knows how to fix this issue?

    http://wordpress.org/extend/plugins/qtranslate-slug-with-widget/

  2. baga
    Member
    Posted 2 years ago #

    Anyone can help?

  3. jhonqwerty
    Member
    Posted 2 years ago #

    Hi baga, i figured it out.

    You have to replace the function that qtranslate uses for generating the alternate links with another that gets the right ones. I put this code in the qtranslate-slug.php and managed to make the alternate language links work.

    In the function qTranslateSlug_remove_qtrans_filters() you have to add this line:

    remove_filter('wp_head', 'qtrans_header');

    And then you have to add this function in another place:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    I tested it and it works OK.

  4. baga
    Member
    Posted 2 years ago #

    Thanks a lot jhonqwerty!!!! It works perfectly :-)

  5. jhonqwerty
    Member
    Posted 2 years ago #

    Nice that it worked for you too, here is the function in pastebin (sorry about the not reading of forum rules.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic