Sitemap for all WordPress and Pods pages?
Is it possible to create a dynamic visual Sitemap as part of my site, that includes both the WordPress pages and Pods pages in the right places?
I have an overall site structure using WP Pages, and I'm using Pods to handle content on some of the 3rd or 4th level pages using wildcard URLs / templates. The function wp_list_pages is fine for building a fully dynamic sitemap, but it obviously doesn't include the Pods pages.
Is this possible to solve?
3 Answers
Since there doesn't seem to be a non-code-heavy solution for this in Pods 1.9, could one of the devs respond as to whether this will be doable in Pods 2?
I built another plugin called Search Engine, it lets you index your site like Google does and it has an option to build a full XML sitemap. It's possible that you could grab that code that generates the XML sitemap and build an HTML sitemap from that.
As for 2.0, we don't currently have a Sitemap function for Pod Pages in the works, but we're open to anyone's ideas if they think there's a way we should accomplish it. If it then doesn't make 2.0, we can work towards 2.x
here is the function:
function pods_pages() {
$file = 'pods_sitemap.xml';
$fileHandle = fopen($file, "rb");
$fileContents = fread($fileHandle, filesize($file));
fclose($fileHandle);
$links = unserialize($fileContents);
$count = count($links['url']);
$generatorObject = &GoogleSitemapGenerator::GetInstance(); //Please note the "&" sign for PHP4!
if($generatorObject != null){
for($i=0; $i<$count; $i++)
{
$generatorObject->AddUrl($links['url'][$i],$links['last_mod'][$i],$links['change_freq'][$i],$links['priority'][$i]);
}
}
}
add_action("sm_buildmap","pods_pages");
edited Jun 20 '11 at 11:34


