Multiple categories in RSS. RSS 1.0 currently broken
git-svn-id: https://develop.svn.wordpress.org/trunk@624 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5aae30a436
commit
382d6400f6
|
@ -1273,7 +1273,12 @@ function the_category($seperator = '') {
|
||||||
}
|
}
|
||||||
|
|
||||||
function the_category_rss() {
|
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() {
|
function the_category_unicode() {
|
||||||
$category = get_the_category();
|
$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);
|
header('Content-type: text/xml', true);
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
|
|
||||||
|
/* This doesn't take into account edits
|
||||||
// Get the time of the most recent article
|
// Get the time of the most recent article
|
||||||
$maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts");
|
$maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts");
|
||||||
$unixtime = strtotime($maxdate);
|
$unixtime = strtotime($maxdate);
|
||||||
|
@ -15,19 +16,20 @@ $cetag = (isset($clast)) ? md5($clast) : '';
|
||||||
// send it in a Last-Modified header
|
// send it in a Last-Modified header
|
||||||
header("Last-Modified: " . $clast, true);
|
header("Last-Modified: " . $clast, true);
|
||||||
header("Etag: " . $cetag, true);
|
header("Etag: " . $cetag, true);
|
||||||
|
*/
|
||||||
|
|
||||||
if (!isset($rss_language)) { $rss_language = 'en'; }
|
if (!isset($rss_language)) { $rss_language = 'en'; }
|
||||||
if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; }
|
if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; }
|
||||||
if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_length = 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 ?>" -->
|
<!-- generator="wordpress/<?php echo $b2_version ?>" -->
|
||||||
<rss version="2.0"
|
<rss version="2.0"
|
||||||
xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||||
|
|
||||||
<channel>
|
<channel>
|
||||||
<title><?php bloginfo_rss("name") ?></title>
|
<title><?php bloginfo_rss('name') ?></title>
|
||||||
<link><?php bloginfo_rss("url") ?></link>
|
<link><?php bloginfo_rss('url') ?></link>
|
||||||
<description><?php bloginfo_rss("description") ?></description>
|
<description><?php bloginfo_rss("description") ?></description>
|
||||||
<language><?php echo $rss_language ?></language>
|
<language><?php echo $rss_language ?></language>
|
||||||
<copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate()); ?></copyright>
|
<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>
|
<comments><?php comments_link(); ?></comments>
|
||||||
<pubDate><?php the_time('r'); ?></pubDate>
|
<pubDate><?php the_time('r'); ?></pubDate>
|
||||||
<author><?php the_author() ?> (mailto:<?php the_author_email() ?>)</author>
|
<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>
|
<guid isPermaLink="false"><?php echo $id; ?>@<?php bloginfo_rss("url") ?></guid>
|
||||||
<?php $more = 1; if ($rss_use_excerpt) {
|
<?php $more = 1; if ($rss_use_excerpt) {
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue