'.gsm_clean_url($sUri).''; if($dtModified!='') { $sReturnXml .= ''.date('Y-m-d\TH:i:s\Z', strtotime($dtModified)).''; } else { $sReturnXml .= ''.date('Y-m-d\TH:i:s\Z').''; } $sReturnXml .= ''.$sFreq.' '.$sPriority.''.\"\n\"; return $sReturnXml; } echo ''; echo ''; $rsLastPost= $wpdb->get_results(" SELECT MAX(post_modified) AS dtModified FROM $wpdb->posts WHERE post_status = 'publish' OR post_status = 'static' ORDER BY post_modified DESC"); echo gsm_url_node(get_option('home'),$rsLastPost[0]->post_modified,'daily','1.0'); echo gsm_url_node(get_option('home').'/feed/',$rsLastPost[0]->post_modified, 'daily','1.0'); $rsSitemap = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'publish' OR post_status = 'static' ORDER BY post_modified DESC"); foreach ($rsSitemap as $oSitemap) { echo gsm_url_node(get_permalink($oSitemap->ID), $oSitemap->post_modified, 'never', '0.5'); } $rsCategories = $wpdb->get_results(" SELECT category_nicename ,MAX(post_modified) AS dtModified FROM $wpdb->posts p JOIN $wpdb->post2cat pc ON p.ID = pc.post_id JOIN $wpdb->categories c ON pc.category_id = c.cat_ID WHERE post_status = 'publish'"); foreach ($rsCategories as $oCategory) { echo gsm_url_node(get_option('home').'/archives/category/'.$sitecat->category_nicename, $oSitemap->dtModified, 'daily', '0.75'); echo gsm_url_node(get_option('home').'/archives/category/'.$sitecat->category_nicename.'/feed/', get_lastpostmodified('GMT'), 'daily', '1.0'); } echo ''; $sSitemapXml = ob_get_clean(); echo gzencode($sSitemapXml, 9); ?>