S Smith revised this gist . Go to revision
1 file changed, 13 insertions
wp-sitemap.php(file created)
| @@ -0,0 +1,13 @@ | |||
| 1 | + | <?php | |
| 2 | + | include( './wp-load.php' ); | |
| 3 | + | header("Content-Type: application/xml"); | |
| 4 | + | ?> | |
| 5 | + | <?xml version="1.0" encoding="UTF-8"?> | |
| 6 | + | <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <?php | |
| 7 | + | foreach(get_pages() as $page) { ?> | |
| 8 | + | <url> | |
| 9 | + | <loc><?php echo get_page_link( $page->ID ); ?></loc> | |
| 10 | + | <lastmod><?php echo date("Y-m-d", strtotime($page->post_modified)); ?></lastmod> | |
| 11 | + | </url> | |
| 12 | + | <?php } ?> | |
| 13 | + | </urlset> | |
    
    
                            
                            Newer
    
    
    Older