Create an XML Feed to Feature Your Jobs on Indeed
Indeed requires several fields that aren't included in the default RSS feed JR comes equipped with. I've created an Indeed compliant XML feed that includes these fields, including Company, City and State.
Just swap out the URL's for your own and cut and paste this into a page template. You'll have a custom XML feed. If you wish, this could also be easily modified to an RSS feed by just changing a few lines of code.
<?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("ExampleURL.com"));
$r->appendChild($publisher);
$publisherurl = $doc->createElement("publisherurl");
$publisherurl->appendChild($doc->createTextNode("http://ExampleURL.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("US"));
$b->appendChild($country);
$r->appendChild( $b );
endwhile;
echo $doc->saveXML();