Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Gunu

    (@grafcom)

    Ah, yes there is a solution….

    The adjustment to make it work with qTranslate X (same as in a previous post)

    In the (Google XML Sitemaps v3 for qTranslate) plugin folder is a file named – sitemap-qtranslate.php
    search qtrans_ and replace it with qtranxf_

    Now for qTranslate Slug –
    At the end of that same file is:

    // Add an extra permalink url for every non-default qTranslate language
    		foreach ($languages as $language) {
    			if ($qt["hide_default_language"] == 1 && $qt["default_language"] == $language) {
    				$sitemap->AddUrl($permalink, $modified_time, $change_freq, $priority);
    			} else {
    				$sitemap->AddUrl(qtranxf_convertURL($permalink, $language, true), $modified_time, $change_freq, $priority);

    Replace this with:

    // Add an extra permalink url for every non-default qTranslate language
    foreach ($languages as $language) {
    if ($qt["hide_default_language"] == 1 && $qt["default_language"] == $language) {
    $sitemap->AddUrl($permalink, $modified_time, $change_freq, $priority);
    } else {
    // get id
    $id = url_to_postid($permalink);
    // get object post
    $post = get_post($id);
    // get slug translation with post->ID
    $title = get_post_meta($post->ID, "_qts_slug_".$language, true);
    if ($title) // if slug translation exist, add to sitemap
    $sitemap->AddUrl(home_url()."/$language/".$title."/", $modified_time, $change_freq, $priority);

    And voila…
    Thanks to Curky
    It is obviously a solution that is reset when the plugin is updated.

    @gunu,
    I do not understand this sentence:

    In the (Google XML Sitemaps v3 for qTranslate) plugin folder is a file named – sitemap-qtranslate.php
    search qtrans_ and replace it with qtranxf_

    I found the file sitemap-qtranslate.php.
    And then what?
    Can you help me please?
    Thank you in advance.

    Plugin Author Gunu

    (@grafcom)

    @tamarin,
    you have Notepad++ ? See here

    Open with Notepad++ the file sitemap-qtranslate.php and use search and replace.

    search for qtrans_ and replace it with qtranxf_

    @Gunu,
    Now I understood everything and changed it.
    Thank you very very much.

    Here there is another solution for the qtranslate slug! I’m using it and it works too; unfortunately I didn’t do a “comparison” to see witch one works better.

    https://www.daniloaz.com/en/google-xml-sitemaps-v3-for-qtranslate-doesnt-work-with-qtranslate-slug/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Google XML Sitemaps v3 for qTranslate and qTranslate Slug’ is closed to new replies.