4-Jun-2014
NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the
FAQ for more details.
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:
foreach($ss as $k => $val) {
$i = BLOG_BASEURL . '?page=' . $val;
$offset = $fp_config['locale']['timeoffset'];
$d = $s['date'] - (60 * 60 * $offset);
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.
If you spot something out of place, please do let me know.
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.
Igor Kromin
Other posts you may like...