Work with xml file and WordPress

Short answer: simplexml_load_file() + wp_insert_post() You want to feed on the XML, and parse it for information that you can use to make posts. Here is a short example, because I am not going to dissect that particular feed for you: $feed = simple_xml_load(‘http://example.com/feed.xml’); if($feed){ foreach($feed[‘items’] as $item){ $post_args = array( ‘post_title’ => $item->title, ‘post_content’ … Read more

Receive error exception using xampp with wordpress

Andrew: As already mentioned, your curl call seems to be returning FALSE. It also appears than when you try to create a SimpleXML element with a boolean FALSE that it throws the exception you are seeing. I have also had problems accessing APIs via curl when on my localhost. I was able to solve it … Read more

Problems with creating hook that updates XML

The 1 character output error is probably because you have a single space before <?php or after ?>. As far as it not doing anything, where is the fruits.xml file? this line: $xml->load(‘fruits.xml’); in this context is looking for the file at: /your/server/path/to/wp-admin/fruits.xml Which I assume is not what you’re expecting. Have a look at … Read more

parse XML from URL (via SOAP)

Lots of places in WordPress use xml_parse including the Atom library, the XML-RPC Library that we use, and SimplePie The oembed class uses SimpleXML. The WordPress Importer and Jetpack actually use both (Jetpack for different things, and the importer tries to use SimpleXML and falls back if it doesn’t exist). Basically, there’s nothing built into … Read more

Import WordPress xml file larger than 8mb

OPTION 1: If a WordPress WXR file, an XML file exported from WordPress, is too large to import, there are several things you might try to overcome that limit. Increase the amount of memory a PHP script may consume. Note: If using a shared hosting service, you may need to ask your host to increase … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)