开发者

How to list the post titles of all the post from my blogspot blog?

I want to display ALL the blog post I've written to my visitors. Blogspot has 'Archive' widget but it displays only the post posted in a particular month/year. I want to display all the posts. Is there any solution to that without using javascript??

(i don't want to us开发者_Python百科e javascript 'cuz some users might have their script disabled)

Thank You.


You have to use a script i guess look at this > http://www.chethstudios.net/p/archives_09.html he is using a seamless script on blogger platform.


I know that this is an old question, but since I did face the same issue by myself today, I wanted to share one possible solution : just add a HTML/JavaScript gadget with the following code :

<div id="all_post_root">Loading ...</div>

<script type="text/javascript">
// Sort the items with respect to their title
var entriesComparator = function(a, b) {
  return a.link[2].title > b.link[2].title;
}

var displayFeed = function(response) {
  var entries = response.feed.entry;
  entries.sort(entriesComparator);

  var listUl = document.createElement("ul");
  for (var i in entries) {
     var elt = entries[i].link[2];

     var a = document.createElement("a");
     a.href = elt.href;
     a.appendChild(document.createTextNode(elt.title));

     var li = document.createElement("li");
     li.appendChild(a);

     listUl.appendChild(li);
  }

  var allPostRoot = document.getElementById('all_post_root');
  allPostRoot.innerHTML = "";
  allPostRoot.appendChild(listUl);
};
</script>

<script src="/feeds/posts/default?alt=json&callback=displayFeed">
</script>

Hope it helps,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜