Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

| Views: 3144
This question has been asked several times so I thought it was about time I've addressed it. Here's a bit of code that will add all of the static pages that are defined in FlatPress to the site map generator output.

The original article for the site map generator can be found here.

Add this code AFTER the while loop in the sitemap.php file:
$ss = static_getlist();
foreach($ss as $k => $val) {
$s = static_parse($val);
$i = BLOG_BASEURL . '?page=' . $val;
$offset = $fp_config['locale']['timeoffset'];
$d = $s['date'] - (60 * 60 * $offset);
$d = date('c', $d);
echo('<url><loc>' . $i . '</loc><lastmod>' . $d . '</lastmod></url>');
}


This will put all of the static links at the end of the generated site map XML. The downside is if you are using static pages to define your block parser widgets, those will be displayed too, sometimes that's not desirable I think.



-i

Have comments or feedback on what I wrote? Please share them below! Found this useful? Consider sending me a small tip.
comments powered by Disqus
Other posts you may like...