Multiple category support for RDF.

git-svn-id: http://svn.automattic.com/wordpress/trunk@634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-22 00:32:05 +00:00
parent 7aa01391d0
commit c3d03c529d
2 changed files with 7 additions and 3 deletions

View File

@ -1272,11 +1272,15 @@ function the_category($seperator = '') {
}
}
function the_category_rss() {
function the_category_rss($type = 'rss') {
$categories = get_the_category();
foreach ($categories as $category) {
$category->cat_name = stripslashes(convert_chars($category->cat_name));
echo "\n<category>$category->cat_name</category>";
if ('rdf' == $type) {
echo "\n<dc:subject>$category->cat_name</dc:subject>";
} else {
echo "\n<category>$category->cat_name</category>";
}
}
}

View File

@ -55,7 +55,7 @@ if (!isset($rss_language)) { $rss_language = 'en'; }
<link><?php permalink_single_rss() ?></link>
<dc:date><?php the_time('Y-m-d\TH:i:s'); ?></dc:date>
<dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
<dc:subject><?php the_category_rss() ?></dc:subject>
<?php the_category_rss('rdf') ?>
<?php $more = 1; if ($rss_use_excerpt) {
?>
<description><?php the_excerpt_rss($rss_excerpt_length, 2) ?></description>