WordPress - Generating custom XML file via Loop contents

catonthecouchproductions
catonthecouchproductions used Ask the Experts™
on
Hey,

I am wondering if it is possible to generate a custom XML file using WordPress. I want to pull information and create a google map with multiple markers. XML would be like:

<markers>
<marker>HTML HERE FOR BOX</marker>
</markers>

I would use a query to pull data from a custom post type. Can WordPress generate custom XML?

Thanks,

Ryan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2016
Commented:
Not sure if WordPress is the right tool for this, but if we can see your test data input and desired outputs we can show you how to do it in PHP.  And since WP is written in PHP it might be easy to integrate the XML generator into your WP code.
Yes, you can do this.

You can also see examples in the google sitemap generator plugin, just open the plugin files and browse the code to get an idea of how they go about it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial