Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Automatic Feed Links"

m (Still some minor grammar changes)
m (Corrected minor typo, Changed "should used" to "should use")
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
  +
{{Languages|
  +
{{en|Automatic Feed Links}}
  +
{{ja|Automatic Feed Links}}
  +
}}
  +
  +
 
'''Automatic Feed Links''' is a [[Theme Features|theme feature]] introduced with [[Version 3.0]]. This feature adds RSS feed links to HTML <tt><head></tt>.
 
'''Automatic Feed Links''' is a [[Theme Features|theme feature]] introduced with [[Version 3.0]]. This feature adds RSS feed links to HTML <tt><head></tt>.
   
'''Note:''' Pre 3.0 sites should used the deprecated [[Function_Reference/automatic_feed_links|automatic_feed_links()]] function.
+
'''Note:''' Pre 3.0 sites should use the deprecated [[Function_Reference/automatic_feed_links|automatic_feed_links()]] function.
   
 
== Adding Theme Support ==
 
== Adding Theme Support ==

Latest revision as of 07:52, 1 September 2016


Automatic Feed Links is a theme feature introduced with Version 3.0. This feature adds RSS feed links to HTML <head>.

Note: Pre 3.0 sites should use the deprecated automatic_feed_links() function.

Adding Theme Support

Since Version 3.0, themes need to use add_theme_support() in the functions.php file to support feed links, like so:

add_theme_support( 'automatic-feed-links' );

Backwards Compatibility

To add backwards compatibility for older versions, use the following code:

global $wp_version;
if ( version_compare( $wp_version, '3.0', '>=' ) ) :
	add_theme_support( 'automatic-feed-links' ); 
else :
	automatic_feed_links();
endif;

Resources

Related

Theme Support: add_theme_support(), remove_theme_support(), current_theme_supports()
Theme Features: sidebar, menus, post-formats, title-tag, custom-background, custom-header, custom-logo, post-thumbnails, automatic-feed-links, html5, editor-style, content_width