Ubuntu / Linux news and application reviews.

Let's start with an example:

The text below will only show up on the rss feed:
Text showing up only on RSS feed, if you are on the website then you cannot see this.

The text below will only show up on the website (will not be available in the RSS Feed):


How to set up the text so it will only show up in the RSS Feed:

In your CSS file, add this:
.hideonwebsite {display: none;}
If you use Blogger, then go to Layout > Edit HTML and paste the above line right before this: ]]></b:skin>

Then, when writing a blog post, wrap the text you wish to only show up in the RSS Feed in a div that has hideonwebsite class, like so:
<div class="hideonwebsite">
Text showing up only on RSS feed, if you are on the website then you cannot see this.
</div>

How to set up the text so it will only show up on the website, and will not be visible in the RSS Feed:

To do so, write a new post and use the following javascript to display the code only on the website:
<script language="JavaScript" type="text/javascript">
if (top.location == self.location) {
document.write("This text will not show up in the rss feed, but only on the website");
}
</script>
Of course, replace This text will not show up in the rss feed, but only on the website with the text you want.
Please note that if you use Blogger, you need to publsh your posts using draft.blogger.com because that's the only way you can have javascript inside blog posts.