A little while ago we put up a helpful script for automating your RSS feed language if it disappears from your settings.  This was an issue I ran into all the time on my site.  My language would just disappear about every 6 months.  I don’t check my feed too often so sometimes it wouldn’t work, and I wouldn’t know it for who knows how long.  While doing my research to find a solution, I ran across another helpful snippet of code.  This one adds a menu item to the reading section of your admin panel for adjusting the language code for your RSS feed.

I’m not sure how many people will need this code, but maybe it will be of some use to someone.  I do see a fair bit of traffic coming to my site on searches for RSS feed language, which makes me think someone may be looking for this.  I don’t remember where this code came from, I’m not so good at taking notes.  So if this code belongs to you, just let me know and I’m happy to give credit!

add_action( 'admin_init', 'voodoo_rss_language_admin_init' );
function voodoo_rss_language_admin_init() {
 register_setting( 'reading', 'rss_language' );
 add_settings_field( 'rss_language', __('RSS Language Code'), 'voodoo_rss_language_string', 'reading');
}

// ADDS RSS LANGUAGE OPTION TO READING SETTINGS
function voodoo_rss_language_string() {
 ?>
 <input name="rss_language" type="text" id="rss_language" value="<?php form_option('rss_language'); ?>" />
 <span><?php _e('RSS supports multiple languages through the language element, which contains a short code that identifies that the natural language employed in the channel. See on this table for your <a href="<a href="http://www.rssboard.org/rss-language-codes#table&quot;>language">http://www.rssboard.org/rss-language-codes#table">language</a> codes</a>.'); ?></span>
 <?php
}

That’s it!  This little bit of code added to your functions.php file will add the menu item, and you’ll be able to adjust your RSS feed language tag.

css.php
%d bloggers like this: