how to publish a feed of posts with a certain custom field value?

Something like this will add a /feed/special to your site.

add_feed('special','do_special_feed');

function do_special_feed() {
  query_posts(array(
    'meta_key' => 'key',
    'meta_value' => 'value',
  ));
  do_feed_rss2(false);
}

After putting it in a plugin or your theme’s functions.php or what have you, you’ll need to visit the Settings->Permalinks page at least once and save the settings, to get it to rebuild the permalink rules.

Leave a Comment