WordPress.org

Ready to get started?Download WordPress

Codex

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

Template Tags/get the content feed

This article is a ROUGH DRAFT. The author is still working on this document, so please do not edit this without the author's permission. The content within this article may not yet be verified or valid. This information is subject to change.

Description

Retrieve the content of the current post formatted for a Feed. This tag must be within The_Loop.

Usage

<?php $content get_the_content_feed$feed_type ?>

Parameters

$feed_type
(string) (optional) The type of feed. rss2, atom, rss or rdf
Default: null

Return Values

(string) 
The post content.

Examples

get_the_content_feed() can be used to retrieve and store the value in a variable, without outputting it to the page.

<?php
$my_content = get_the_content_feed();
if ( $my_content != '' ) {
	// Some string manipulation performed
}
echo $my_content; // Outputs the processed value to the page
?>

Change Log

Since: 2.9.0

Source File

get_the_content_feed() is located in wp-includes/feed.php.

Related

the_content_feed()

See also index of Function Reference and index of Template Tags.