Showing posts with label blog. Show all posts
Showing posts with label blog. Show all posts

Wednesday, 24 July 2013

How To Add “Read More” Posts Link in Blogger

With this trick, you can choose to display a select amount of text from the beginning of each post as a teaser instead of showing the entire post on the front page of your blog. Then when people want to read the rest of the post, they can click a “read more” link to see the full post. This is very handy if you have lots of long articles all on one page.
Step #1 - Update Your Template Code First you need to edit your existing code. Go to Layout >> Edit HTML. There you first click on "Expand Widget Templates" showing right above the HTML editor box. Now do a search (CTRL + F) within the HTML editor box for the following code <data:post.body/>. Now add the following code just above the <data:post.body/> tag.
<b:if cond='data:blog.pageType == "item"'> <style>.fullpost{display:inline;}</style> <p><data:post.body/></p> <b:else/> <style>.fullpost{display:none;}</style>

The result should look something like this:

Now let’s add one more bit of code which will actually create the “read more” link in your post. This code will go below the <data:post.body/>tag so copy the following and paste it in. Feel free to change the “Read more…” text to whatever you want the link to look like. Be careful not to delete any other code during this process.
<b:if cond='data:blog.pageType != "item"'><br /> <a expr:href='data:post.url'>Read more...</a> </b:if> </b:if>

Yes, there are supposed to be two </b:if> tags in the above code so don’t think it’ s a mistake. The result should look like this: new-code-block-2.png This code will be the same no matter what template you are using. Just make sure it goes below the <data:post.body/> as shown in the image above. Now let’s look at what the final result should be. Here’s the updated code block you just worked on all put together: new-code-block-3.png
Ok, now save it. If it get saved means you have done it well. So move to the next step: Step #2 - Add a Class Tag in Your Default Post Template For this step go to Settings >> Formattingand scroll all the way down to the bottom. It’s the last option called “Post Template”. You’re going to paste in the following code:
<span> </span>

You’ll want to keep the spaces in there which will make sense later. After you save this, it will look like this: post-template2.png
Step #3 - Create a New Post Ok, we’ve got everything all setup so it’s time to go and test it out. Hopefully you’ve got a new post in mind for your blog. If not, then we’ll just create a test post which you can later delete. When you click on the “Posting” tab, you’ll notice that the post text area is now pre-populated with the <span class=”fullpost”> and </span> tags. If not, then you didn’t save it properly so go back and re-read step #2.
So when writing your new post, anything you put above the <span class=”fullpost”> tag will be the teaser text. The main body of your post needs to go in between the <span class=”fullpost”> and </span> tags in order for the “read more…” link to work properly. See the screenshot below. Sometimes pictures illustrate better than words.
Now publish or preview your post to see the “read more” hack working on your blog. If it doesn’t show up for some reason, go back and run through the steps again. Most likely you pasted the code blocks in the wrong places. It’s difficult to troubleshoot these issues since each template can be unique so please make sure to double-check your template before asking for help in the comments section below.
Here’s the live post with the “read more…” link properly working based on the text I used above in the post text area.
post-results.png
Additional Info If you want to go back and update your old posts with this new “read more…” feature you can. Just go back and edit each post manually. Essentially you’ll need to paste in the <span class=”fullpost”> and </span> tags breaking apart the post into two parts.
For some posts, you might not want to use this feature at all. If that’s the case, just delete the <span class=”fullpost”> and </span> tags from within your new post text area. Then your new post will show up entirely just like it used to before you implemented this hack. Enjoy!

Sunday, 19 February 2012

How to Add Marquee effect in Blogspot

This post explains you how to add Scrolling text ( also called as marquee ) to your blog sidebars,blog posts,etc.
Another way to attract the visitors is adding some decoration to the site like scrolling text,etc.But,don't decorate it too much,particularly if your site contains too much text as it irritates and spoils the concentration of the reader.You can add scroll bars to tell your visitors what will be your next updates,popular posts,advertisements,etc.
So,how to add the scrolling text in your blog,let me explain it:

Adding simple scrolling text:
Here is the code to add a simple scrolling text from right to left side


The output will be like:
Example 1:
code to simple scrolling text

If you want some more attraction,then try these,
Add a background color to the text:

Example 2:
code to simple scrolling text

You can choose your background colour by replacing the hexadecimal code(#99ccff).
Click here to see the codes of the different colors.

Here are some mode attributes to learn:






direction="left"
direction="right"
direction="up"
direction="down"

The above attributes tells the text which direction to scroll.
Use the code below:

Here are some examples:
Example 3:
To scroll in the 'right' direction:
code to simple scrolling text

Example 4:
To scroll in the 'up' direction:
code to simple scrolling text

Example 5:
Down: ( I changed the hexa decimal codes for different colours )
code to simple scrolling text

few more attributes:
You can add this attribute to alternate the text

Here is the code to do this:

Example 6:
code to simple scrolling text
You can also set the speed of the text with this simple attribute:

The lower the scrollamount value, the less the speed it moves,
the html code for this:

example 7:(for scrollamout =2)
code to simple scrolling text

Example 8:(for scrollamount=5)
code to simple scrolling text

Pausing the text when mouse is over the text:
It is very useful when the reader wants to read the text,and the scrollamount is big, so that he will put the mouse over the text to pause the text and read the matter:
Here is the code to do this

Example 9:
code to simple scrolling text

(place the mouse over the text to test it)

Changing the text colour:
Here is the code to change the text colour:(Add it before and after the marquee tags)

So, the code looks like this

Example 10:
Code to simple scrolling text

Adding hyperlinks:
You can also add the hyperlinks in text.
Here is the sample code:

The output will look like this:
Remove Navbar # Internet tips # Add Read More tag in Blog
That's it!Now you can add this to your blogger sidebar,in the blog post,where ever you want.

If you have any doubts, ask your questions via your comments.