I’m not looking for a sitemap, I’m looking to create an xml file that I can have a flash menu access, but I don’t want to generate the XML file each time someone visits a page, I want to have a static XML to refer to for speed. And I’d like to have wordpress update the file whenever new content is posted(not comments).
Is there anything built into wordpress that would allow me to do this? Any plugins? Again, I don’t want a sitemap. I want a specific list of items. Right now I’ve been using page templates with custom loops, but it takes to long to generate every time.
Hmm… not sure if there are any WordPress-specific functions for creating files. There’s wp_handle_upload, but I’m not sure how you’d use it in this context.
Depending on your server configuration, you can probably just use fopen and fwrite to do this.
Keep the code you’re currently using (with your custom loops…I’m assuming they contain the XML markup you want), but have it build the output as a string. Then save that string into a file. Something like:
Of course, this all depends on your server config and permissions. Maybe someone has a better solution that only requires native WP functions.
Nothing built-in but you should look into the various sitemaps plugins. These will show you a) where to hook into and b) how to generate the file if you’re not familiar with php file manipulation.
Take a look at the export_wp function.
Make a duplicate of it and keep only the stuff you want exported, then run this function every time a post is saved:
add_action('save_post', 'my_export_wp');
(Make so the function sends its output to a xml file)