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

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

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.