Problem with Indeed Feed
Hello
I noticed yesterday that since I updated to Jobroller 1.7.1, Indeed can no longer use my xml feed to get jobs and publish them, while there were no problem with Jobroller 1.6.4
Anyone knows what to do? Do I have to change something in my php file?
thanks !
<?php
//Template Name: Indeed XML Generator
header('Content-Type: text/xml');
$doc = new DOMDocument('1.0','utf-8');
$doc->formatOutput = true;
//root element
$r = $doc->createElement( "source" );
//append root element to our document
$doc->appendChild( $r );
$publisher = $doc->createElement("publisher");
$publisher->appendChild($doc->createTextNode("http://www.mywebsite.com"));
$r->appendChild($publisher);
$publisherurl = $doc->createElement("publisherurl");
$publisherurl->appendChild($doc->createTextNode("http://www.mywebsite.com"));
$r->appendChild($publisherurl);
$job = array();
//set args for query
$args = array(
'post_type' => 'job_listing',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC'
);
//run query
$feed_jobs = new WP_Query($args);
while($feed_jobs->have_posts()) : $feed_jobs->the_post();
$b = $doc->createElement( "job" );
$title = $doc->createElement("title");
$title->appendChild($doc->createCDATASection( $post->post_title));
$b->appendChild( $title );
$company_name = get_post_meta($post->ID,'_Company',true);
$company = $doc->createElement("company");
$company->appendChild($doc->createCDATASection($company_name));
$b->appendChild($company);
$date = $doc->createElement("date");
$date->appendChild($doc->createCDATASection($post->post_date));
$b->appendChild($date);
$referencenumber = $doc->createElement("referencenumber");
$referencenumber->appendChild($doc->createCDATASection($post->ID));
$b->appendChild($referencenumber);
$url = $doc->createElement("url");
$url->appendChild($doc->createCDATASection($post->guid));
$b->appendChild($url);
$description = $doc->createElement("description");
$description->appendChild($doc->createCDATASection($post->post_content));
$b->appendChild($description);
//query postmeta table for city and state// then parse it into an array
$location = get_post_meta($post->ID,'geo_address',true);
$location = explode(',',$location);
$city = $doc->createElement("city");
$city->appendChild($doc->createCDATASection($location[0]));
$b->appendChild($city);
$state = $doc->createElement("state");
$state->appendChild($doc->createCDATASection($location[1]));
$b->appendChild($state);
$country = $doc->createElement("country");
$country->appendChild($doc->createCDATASection("France"));
$b->appendChild($country);
$r->appendChild( $b );
endwhile;
echo $doc->saveXML();