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

  1. baga
    Posted 4 years ago #

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


    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?


  2. baga
    Posted 4 years ago #

    Anyone can help?

  3. pabloselin
    Posted 4 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
    Posted 4 years ago #

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

  5. pabloselin
    Posted 4 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

  • qTranslate slug with widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic