Title: RSS2 feed
Last modified: December 25, 2016

---

# RSS2 feed

 *  [Geoffrey Sneddon](https://wordpress.org/support/users/link92/)
 * (@link92)
 * [22 years, 2 months ago](https://wordpress.org/support/topic/rss2-feed/)
 * I have <pre>
    <?php echo ‘<?xml version=”1.0″?’.’>’; ?> <?php $blog = 1; $doing_rss
   = 1; header(‘Content-type: text/xml’, true); require(‘wp-blog-header.php’); /*
   This doesn’t take into account edits // Get the time of the most recent article
   $maxdate = $wpdb->get_var(“SELECT max(post_date) FROM $tableposts”); $unixtime
   = strtotime($maxdate); // format timestamp for Last-Modified header $clast = 
   gmdate(“D, d M Y H:i:s \G\M\T”, $unixtime); $cetag = (isset($clast)) ? md5($clast):”;//
   send it in a Last-Modified header header(“Last-Modified: ” . $clast, true); header(“
   Etag: ” . $cetag, true); */ if (!isset($rss_language)) { $rss_language = ‘en’;}
   if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; } if (!isset($rss_excerpt_length)
   || ($rss_encoded_html == 1)) { $rss_excerpt_length = 0; } ?> <rss version=”2.0″
   xmlns:content=”[http://purl.org/rss/1.0/modules/content/”&gt](http://purl.org/rss/1.0/modules/content/”&gt);
   <channel> <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp();?
   > <item> <content:encoded><?php the_content(”, 0, ”) ?></content:encoded> </item
   > <?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { 
   break; } } } ?> </channel> </rss> </pre> but I want it only to show the latest
   piece of news.

The topic ‘RSS2 feed’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Geoffrey Sneddon](https://wordpress.org/support/users/link92/)
 * Last activity: [22 years, 2 months ago](https://wordpress.org/support/topic/rss2-feed/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
