Title: Generate an XML using wordpress functions
Last modified: August 19, 2016

---

# Generate an XML using wordpress functions

 *  [milotimbol](https://wordpress.org/support/users/milotimbol/)
 * (@milotimbol)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/generate-an-xml-using-wordpress-functions/)
 * Hi,
 * I’m trying to load markers on a google map. I have a function called placeMarkersAjax
   which accepts a parameter xml.
 * placeMarkersAjax(‘<?php bloginfo(‘template_url’); ?>/markers.xml.php’);
 * What i did was point this to a php file in my template directory. It works fine
   if the content of the php is like this.
 * <?xml version=”1.0″?>
    <markers> <marker> <name>Name</name> <lat>11.972913599129404
   </lat> <lng>121.91499352455139</lng> </marker> </markers>
 * The marker is successfully loaded in the map. However I want to loop through 
   posts and grab a latitude and longitude custom fields. So I need to use wordpress
   functions. When I add
 * <?php
    require(‘../../../wp-blog-header.php’); ?>
 * on top of the file. It no longer works. When I try to access the file in the 
   browser. The XML content looks the same if the require code is there or not.
 * I guess how do I use wordpress functions in this case? when i try to add the 
   require line javascript no longer parses the xml. I also tried adding
 * header(‘Content-Type: text/xml’);
 * It still doesn’t work.
 * Please help me.
 * thanks,
    Milo

The topic ‘Generate an XML using wordpress functions’ is closed to new replies.

## Tags

 * [wordpress functions](https://wordpress.org/support/topic-tag/wordpress-functions/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * 0 replies
 * 1 participant
 * Last reply from: [milotimbol](https://wordpress.org/support/users/milotimbol/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/generate-an-xml-using-wordpress-functions/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
