Using Gengo & karailievs-sitemap plugins for Wordpress.

This is the deal: Gengo changes the way url’s are handle and it adds a /lang_code/ to the end of every page/article.

In the other hand, karailievs-sitemap build the sitemap file with standard url’s.

Result: google complains that most of the urls on the sitemap are redirects.

I found an easy fix in the ksm.php of karailievs-sitemap plugin.

Below is the diff between original ksm.php & mine:


— ksm.php.original 2008-09-25 13:32:09.000000000 +0000
+++ ksm.php 2008-09-25 13:39:28.000000000 +0000
@@ -160,9 +160,12 @@
$result = mysql_query(”
SELECT
`”.$t.”posts`.`ID`, `”.$t.”posts`.`post_date_gmt`, `”.$t.”posts`.`post_date`, `”.$t.”posts`.`post_modified_gmt`, `”.$t.”posts`.`post_name`, `”.$t.”posts`.`post_type`,
- MAX(`”.$t.”comments`.`comment_date_gmt`) AS `comment_date_gmt`, MAX(`”.$t.”comments`.`comment_date`) AS `comment_date`
+ MAX(`”.$t.”comments`.`comment_date_gmt`) AS `comment_date_gmt`, MAX(`”.$t.”comments`.`comment_date`) AS `comment_date`,
+ `”.$t.”languages`.`code` as lang_code
FROM `”.$t.”posts`
LEFT JOIN `”.$t.”comments` ON `”.$t.”comments`.`comment_post_ID` = `”.$t.”posts`.`ID`
+ LEFT JOIN `”.$t.”post2lang` ON `”.$t.”post2lang`.`post_id` = `”.$t.”posts`.`ID`
+ LEFT JOIN `”.$t.”languages` ON `”.$t.”languages`.`language_id` = `”.$t.”post2lang`.`language_id`
WHERE
`”.$t.”posts`.`post_status`=’publish’
AND (
@@ -186,7 +189,7 @@
if ($now - $postDate < $treeDays) {
$out_news .= "

- “.get_permalink($data['ID']).”
+ “.get_permalink($data['ID']).$data['lang_code'].”/

“.str_replace(” “, “T”, $data['post_date_gmt']).”Z”.”


Good luck! if it doesn’t work for you try at least twice, then if keeps failing drop me an e-mail and I’ll try to help.

Translations: No Translations Available

Tags: , , ,

WordPress database error: [Can't open file: 'wp_comments.MYI'. (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = 124 AND comment_approved = '1' ORDER BY comment_date

Leave a Reply