Multiple categories in RSS. RSS 1.0 currently broken
git-svn-id: http://svn.automattic.com/wordpress/trunk@624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
50ef006a57
commit
bfefe94945
|
@ -1273,7 +1273,12 @@ function the_category($seperator = '') {
|
|||
}
|
||||
|
||||
function the_category_rss() {
|
||||
echo convert_chars(strip_tags(get_the_category()), 'xml');
|
||||
$categories = get_the_category();
|
||||
foreach ($categories as $category) {
|
||||
$category->cat_name = stripslashes(convert_chars($category->cat_name));
|
||||
echo "\n<category>$category->cat_name</category>";
|
||||
}
|
||||
|
||||
}
|
||||
function the_category_unicode() {
|
||||
$category = get_the_category();
|
||||
|
|
10
wp-rss2.php
10
wp-rss2.php
|
@ -4,6 +4,7 @@ $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);
|
||||
|
@ -15,19 +16,20 @@ $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; }
|
||||
?>
|
||||
<?php echo "<?xml version=\"1.0\"?".">"; ?>
|
||||
<?php echo '<?xml version="1.0"?'.'>'; ?>
|
||||
<!-- generator="wordpress/<?php echo $b2_version ?>" -->
|
||||
<rss version="2.0"
|
||||
xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||
|
||||
<channel>
|
||||
<title><?php bloginfo_rss("name") ?></title>
|
||||
<link><?php bloginfo_rss("url") ?></link>
|
||||
<title><?php bloginfo_rss('name') ?></title>
|
||||
<link><?php bloginfo_rss('url') ?></link>
|
||||
<description><?php bloginfo_rss("description") ?></description>
|
||||
<language><?php echo $rss_language ?></language>
|
||||
<copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate()); ?></copyright>
|
||||
|
@ -41,7 +43,7 @@ if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_leng
|
|||
<comments><?php comments_link(); ?></comments>
|
||||
<pubDate><?php the_time('r'); ?></pubDate>
|
||||
<author><?php the_author() ?> (mailto:<?php the_author_email() ?>)</author>
|
||||
<category><?php the_category_rss() ?></category>
|
||||
<?php the_category_rss() ?>
|
||||
<guid isPermaLink="false"><?php echo $id; ?>@<?php bloginfo_rss("url") ?></guid>
|
||||
<?php $more = 1; if ($rss_use_excerpt) {
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue