How to add Recent Post Via Script in blogger/blogspot

In previous posts I've discussed on how to add recent posts via feed. Well, in this post I will discuss how to add recent post via script.

What is the difference between the recent post via feed with a recent post via script?

Both this way each has advantages and disadvantages. If a recent post via feed, loading the page is not heavy, but post loading a very long. While recent post via the script, post loading faster, but loading the blog a little longer.

For those of you who give priority to the speed of loading the blog, use a recent post via feed. But if you want new posts more quickly out, then use this way.

1. Login to Blogger and click the Layout -> Page Elements
2. Click the Add a Gadget -> HTML / Javascript
3. Copy the code below and paste it into the box "content".

<script style="text/javascript" src="http://hbhost.googlecode.com/files/recent_posts.js"></script><script style="text/javascript">var numposts = 5;var showpostdate = false;var showpostsummary = false;var numchars = 50;var standardstyling = true;</script><script src="http://Your-blog.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentposts"></script>

Note:

Number 5 on numposts, indicate the number of posts that appear. Replace as you wish.

false at showpostsdate indicates the date of posting is not displayed. Replace the "true" if you want to display the date of posting.

false at the postshowsummary shows the contents of posts are not shown. Replace the "true" if you want to display it.

Figures 50 on numchars shows the number of letters that appear. This only applies if showpostsummary = true.

Replace the bold text with the name of your blog.

4. Then click save. finish



Related Posts

G+

0 comments:

Post a Comment