Ok, that's a weird question, I know..
I'm so confortable with WP that I don't want to use any other application to generate XML (KML - Editors note: These are Google Earth files.) files.
I want to use a custom post type with nothing else just a bunch of custom fields and meta boxes. I have the XML schema (a custom single.php) set up: certain custom field values goes in between the right XML tags and in theory I have an XML that I'm able to create, modify and delete with WP.
The problem is that it is still a php/html file and not an xml, and the browser uses it as a html/php file and tries to interpret it as html even though xml is declared at the top.
Is there a libary or a way to grab the html output of these files and somehow convert it to XML?
UPDATE 1: That's how I get a placemark's name (it gives you the name) but without the tags:
<?php if(get_field('marker_style')): ?> <?php while(the_repeater_field('marker_style')): ?> <?php echo '<name>' the_sub_field('marker_style_id') '</name>' ;?> <?php endwhile; ?> <?php endif; ?>
Update 2: With the help a tutorial I came up with this code: http://pastebin.com/zGJHm19t
But it's not working. It looks that I can't store my field values in variables and use them on the page in this context. You may think it's because of the plugin I use for custom fields, but that's not the case: if I put a simple
$title = the_title() and then I try to echo the
$title I get nothing.
On line 39-42 the original tutorial gave the values themselves and the XML got populated with them beautifully. The logic here is that I store the values in variables and use the vars here, but as I mentioned, for some reason I don't see right now, the variables are empty.