Ok so according to Google your sitemap shoul be as follows.
I need help with the Lastmod tag
My current function is like this.Code:<url> <loc>http://www.example.com/</loc> <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url>
Which doesnt include the lastmod tag.PHP Code:function genSiteMap() {
global $baza, $clear;
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n";
$xml .= "\t<url>\n\t\t<loc>" . ROOT . "</loc>\n\t\t";
$xml .= "<priority>1</priority>\n\t\t";
$xml .= "<changefreq>" . $clear . "</changefreq>\n\t";
$xml .= "</url>\n";
$xml .= "\t<url>\n\t\t<loc>" . ROOT . "index.php</loc>\n\t\t";
$xml .= "<priority>0.9</priority>\n\t\t";
$xml .= "<changefreq>" . $clear . "</changefreq>\n\t";
$xml .= "</url>\n";
$sql = "SELECT query, cat FROM cache";
$baza -> izvrsiUpit($sql);
$baza -> stvoriNiz();
while($red = $baza -> noviRed()) {
$xml .= "\t<url>\n\t\t<loc>" . ROOT . "txt/1/10/" . urlencode($red["query"]) . ".html</loc>\n\t\t";
$xml .= "<priority>0.8</priority>\n\t\t";
$xml .= "<changefreq>" . $clear . "</changefreq>\n\t";
$xml .= "</url>\n";
}
$xml .= "</urlset>";
file_put_contents('sitemap.xml', $xml);
}
Can anyone help me add it?
Tim..



Reply With Quote

Bookmarks