Adding custom fields to your WordPress RSS feed

Our website uses the WP Job Manager plugin to manage the recruitment side of the web site, and after much hacking of the template, we’ve got it nailed now for the different job types in different job categories.

When asked to submit an RSS feed to AllTheTopBananas.com it came back as a fail as they need the salary and location fields. Hmmm, ok no problem. Add an action to put those custom fields into the RSS like this.

What could possibly go wrong?

Hmmmm guess who forgot how picky XML validation is and forgot to encode the $value.  Schoolboy error, so wrap the string with wptexturize():

And bingo. Validation finally. Maybe I should have checked with the W3C XML Validator first before sending it off again.

Leave a Reply