Forums

[resolved] Create XML pages with the help of WP post edit (5 posts)

  1. elba00
    Member
    Posted 8 months ago #

    Hi,

    I was wondering as I'm so accustomed to the WP admin if using a custom post type and just custom fields and metaboxes on its edit screen would be ok to create XML files?

    Custom field values would be values between certain tags in the xml and with the help of a custom single.php file I would able to echo these values between <tags></tags> with the name tags echoed as well - and basically I could use that page an xml file later. (and probably save the page to the server as proper xml file)

    I made a quick test and although I'm declaring the page as XML (without header, footer) the XML name tags are stripped and only the values are shown:
    <?php echo '<name>some name</name>' ; ?>
    is just
    some name

    I know it sounds crazy but the idea to use the WP admin as an XML editor and publisher come to mind and now I can't get rid of it.

    Would it possible?

    thx

  2. NateJacobs
    Member
    Posted 8 months ago #

    This plugin might help. Or it can give you a starting point to build your own.

  3. elba00
    Member
    Posted 8 months ago #

    Thanks Nate, I'll look into the code.
    I've already started writing a page myself but got some difficulties storing field values in variables: http://pastebin.com/zGJHm19t

  4. elba00
    Member
    Posted 8 months ago #

    With a little help I've found a way to output custom field values to xml from a wordpress post. You can find a working code snippet here that creates a kml placemark.

  5. NateJacobs
    Member
    Posted 8 months ago #

    Cool, I have been looking to do something similar. I'll take a look at your code.

Reply

You must log in to post.

About this Topic