WordPress.org

Codex

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

Function Reference/the excerpt rss

Description

Display the post excerpt for the feed.

Usage

<?php the_excerpt_rss() ?>

Parameters

None.

Return Values

(void) 
This function does not return a value.

Examples

To create a custom feed that takes a GET parameter on a URL (e.g. http://www.example.com/?feed=myfeed&type=excerpt), place something like the following in your particular feed file to send an excerpt (the_excerpt_rss()) instead of the full content (the_content()):

<?php
if isset($_GET['type'])) { $typewanted = $_GET['type']; }
if ($typewantd=='excerpt') {
  // Wrap the Excerpt in a span tag for CSS styling
  echo '<span class="excerpt">'; 
  the_excerpt_rss();   
  echo '</span>';
} else {  
  // Otherwise they want the full content so wrap it in another span
  echo '<span class="content">';
  the_content();
  echo '</span>';
}
?>

Notes

Change Log

Since: 0.71

Source File

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

Related

wp_trim_excerpt()
the_content()

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