Toon Van Dooren
Toon Van Dooren

Reputation: 613

Wordpress posts to xml

I have a project where i have to link values given the wordpress backend to xmls, since i am new to Worpress i don't know where to start.

So the xml looks like this

    <?xml version="1.0"?>
<articles>
    <article>
        <title><![CDATA[Teddiedrum - The Audience]]>
        </title>
        <image><![CDATA[http://niteversions.com/uploads/Teddiedrum-The-Audience-490x490.jpg]]>
        </image>
        <content>
            <![CDATA[Oei.]]>
        </content>
        <date>
            <![CDATA[16/04/2012]]>
        </date>
    </article>
    <article>
        <title><![CDATA[Soap&Skin - Boat Turns Toward The Port ]]>
        </title>
        <image><![CDATA[http://neuundgut.zib21.com/wp-content/uploads/2011/12/soap-skin-boat-turns-towards-the-boat-video.jpg]]>
        </image>
        <content>
            <![CDATA[Elke aanleiding moéten we gebruiken om deze magistrale Soap&Skin-song te posten. We geraken immers nog steeds niet uit de wurggreep van ‘Boat Turns Toward The Port’. De 22-jarige Anja Plaschg slaat ons, op amper 2:30, compleet murw met dit hartverscheurend, schuifelend treurlied. Alle haren overeind, woensdagavond in AB, Brussel.]]>        
        </content>
        <date>
            <![CDATA[17/04/2012]]>
        </date>
    </article>
    <article>
        <title><![CDATA[Mr. Scruff Vs Kirsty Almeida - Pickled Spider]]>
        </title>
        <image><![CDATA[http://ecx.images-amazon.com/images/I/41HRpRNhG-L.jpg]]>
        </image>
        <content>
            <![CDATA[De dolgedraaide Ninja Tuner Mr Scruff palmt vrijdag - van 20u30 tot 2u (!) - het podium van de Brusselse VK* in. Mail snel naar [email protected] met als subject Mr. Scruff voor één van de 3 gratis duotickets. De winnaars maken we hier donderdag bekend. “Maar als je niet tegen vette bassen kan, ben blijf je beter thuis”, waarschuwt hij. Doe de bass-test met deze ‘Pickled Spider’.]]> 
        </content>
        <date>
            <![CDATA[18/04/2012]]>
        </date>
    </article>
    <article>
        <title><![CDATA[DJ Muggs feat Dizzee Rascal & Bambu - Snap Ya Neck Back]]>
        </title>
        <image><![CDATA[http://www.danceeuphoria.com/wp-content/uploads/2012/03/djmuggssnapyaneckback.jpg]]>
        </image>
        <content>
            <![CDATA[Een goed jaar geleden op de RifRaf-cover, nu bruutweg een banaan molesterend. Tsssss.]]> 
        </content>
        <date>
            <![CDATA[18/04/2012]]>
        </date>
    </article>
    <article>
        <title><![CDATA[Steak Number Eight - Dickhead]]>
        </title>
        <image><![CDATA[http://userserve-ak.last.fm/serve/500/6144813/Steak+Number+Eight++010.jpg]]>
        </image>
        <content>
            <![CDATA[Een goed jaar geleden op de RifRaf-cover, nu bruutweg een banaan molesterend. Tsssss.]]>
        </content>
        <date>
            <![CDATA[19/04/2012]]>
        </date>
    </article>
    <article>
        <title><![CDATA[The Heart Is A Drum - Drums Are For Parades feat. Tim Vanhamel]]>
        </title>
        <image><![CDATA[http://www.liegecity.be/wp-content/uploads/2012/03/DrumsAreForParade.jpg]]>
        </image>
        <content>
            <![CDATA[De 'IMPERIVM’-picture disc van Drums Are For Parades is één van de vele, unieke releases nav Record Store Day, nu zaterdag. Drums Are For Parades sluiten trouwens die hoogdag van de onafhankelijke platenwinkels ’s avonds live af in Handelsbeurs, Gent. Uit ‘IMPERIVM’, deze ‘The Heart Is A Drum’ feat. Tim Vanhamel.]]>
        </content>
        <date>
            <![CDATA[20/04/2012]]>
        </date>
    </article>
</articles>

What i want is to make fields in the backend like title, image, content, date and everytime this field is saved it adds a new node to the xml.

Any information on how to start doing this / the steps i have to undertake would be welcome.

Kind regards

Toon

Upvotes: 0

Views: 545

Answers (2)

maiorano84
maiorano84

Reputation: 11951

As mentioned, your best bet would be to search existing plugins. I would start with this one and maybe see about modifying it to your needs:

http://wordpress.org/extend/plugins/backwpup/

Upvotes: 0

Mohit Bumb
Mohit Bumb

Reputation: 2493

There's already 2 tools available in wordpress import and export xml in backend just install that and you'll get what you want there's no need to do any custom thing on every post but if you still want it then read about 'publish_post' hook

Upvotes: 1

Related Questions