It is easy to give a better look to your rss feed in wordpress with with CSS (cascading style sheets). I'll show you a tutorial of 10 minutes , you can see the results by looking at the RSS feed of this site. Also you can do with XSL style but for now we are going to do with CSS that is easier. To start you need to add the tag xml-stylesheet to your RSS feed , for it opens the file wp-rss2.php and after the line:
<? Php echo '<? xml version = "1.0" encoding = "'. get_settings (' blog_charset ').'"? '.'> ';?>
added:
<? Php echo "\ n <? Xml-stylesheet type = \" text / css \ "href = \" ";?>
<? Php bloginfo ('stylesheet_directory');?>
<? Php echo "/ rss.css \"> ";?>
Then you have to create the file rss.css and place it in your theme directory within this file you define how to display RSS tags, an example of the contents of this file is as follows:
rss {
display : block;
font-family: Verdana, arial;
font-size: x-small;
}
channel link {
display : block;
margin: 5px 6px;
}
channel description {
display : block;
margin: 5px 6px;
}
item {
background : # E8F8FD;
display : block;
margin: 10px 30px;
padding: 5px;
border: 1px dotted # aaa;
}
title {
font: bold large Arial, Helvetica, sans-serif;
display : block;
margin: 5px;
padding: 2px;
color: # 333;
border-bottom: 1px solid silver;
}
item title {
font-size: medium;
color: # 666;
}
channel {item link
display : block;
margin: 0;
}
{comments
display : block;
}
{docs
display : block;
margin: 20px;
text-align: center;
padding: 5px;
color: # 7f7f7f;
border: 1px solid silver;
}
channel item description {
display : block;
background : # fff;
border: 1px dotted # f5f5f5;
margin: 3px 5px;
}
/ * To hide labels * /
language, lastBuildDate, ttl, guid, category, pubDate, generator {
display : none;
}
Apparently the Internet Explorer 7 Beta, I would not recommend using is not the style sheets of the RSS, however the RSS will show its own format of them, in Firefox it looks great.
Thank You!
0 comments:
Post a Comment