Sitemap

get_results( “SELECT ID, post_title, post_modified_gmt
FROM $wpdb->posts
WHERE post_status = ‘publish’
AND post_password = ”
ORDER BY post_type DESC, post_modified DESC
LIMIT 50000″ );
header( “HTTP/1.1 200 OK” );
header( ‘X-Robots-Tag: noindex, follow’, true );
header( ‘Content-Type: text/xml’ );
echo ‘‘ . “\n”;
echo ‘‘ . “\n”;
$xml = ‘‘ . “\n”;
$xml .= “\t” . “\n”;
$xml .= “\t\t” . home_url( ‘/’ ) . “\n”;
$xml .= “\t\t” . mysql2date( ‘Y-m-d\TH:i:s+00:00’, get_lastpostmodified( ‘GMT’ ), false ) . “\n”;
$xml .= “\t\t” . ‘daily’ . “\n”;
$xml .= “\t\t” . ‘1’ . “\n”;
$xml .= “\t
” . “\n”;
foreach ( $posts as $post ) {
if ( $post->ID == get_option( ‘page_on_front’ ) )
continue;
if ( ! empty( $post->post_title ) ) {
$xml .= “\t\n”;
$xml .= “\t\t” . get_permalink( $post->ID ) . “\n”;
$xml .= “\t\t” . mysql2date( ‘Y-m-d\TH:i:s+00:00’, $post->post_modified_gmt, false ) . “\n”;
$xml .= “\t\t” . ‘weekly’ . “\n”;
$xml .= “\t\t” . ‘0.8’ . “\n”;
$xml .= “\t
\n”;
}
}
$xml .= ‘
‘;
echo ( “$xml” );
exit();
}

Shares 0