Recent post

রবিবার, ৭ জানুয়ারী, ২০১৮

How to show all blog post in blogger sidebar

How to show all blogpost in blogger sidebar?

To show all the blog post in sidebar follow below instructions. 
copy blue color html code and use it in your blogger.


<div><ul id="postList12"></ul></div>
<script type="text/javascript">
var startIndex = 1;
var maxResults = 100;
function sendQuery12()
{
var scpt = document.createElement("script");
scpt.src = "/feeds/posts/summary?alt=json&callback=processPostList12&start-index=" + startIndex + "&max-results=" + maxResults;
document.body.appendChild(scpt);
}
function processPostList12(root)
{
var elmt = document.getElementById("postList12");
if (!elmt)
return;
var feed = root.feed;
if (feed.entry.length > 0)
{
for (var i = 0; i < feed.entry.length; i++)
{
var entry = feed.entry[i];
var title = entry.title.$t;
for (var j = 0; j < entry.link.length; j++)
{
if (entry.link[j].rel == "alternate")
{
var url = entry.link[j].href;
if (url && url.length > 0 && title && title.length > 0)
{
var liE = document.createElement("li");
var a1E = document.createElement("a");
a1E.href = url;
a1E.textContent = title;
liE.appendChild(a1E);
elmt.appendChild(liE);
}
break;
}
}
}
if (feed.entry.length >= maxResults)
{
startIndex += maxResults;
sendQuery12();
}
}
}
sendQuery12();
</script>



Putting the code in a Gadget
Inserting code in sidebars - left or right, of a Blog.


Step:1. Go to Dashboard>>Layout
Step:2. Select add a Gadget Link
Step:3. Select HTML/Javascript gadget
Step:4. Enter the Title of your Widget, e.g. All Posts List
Step:5. Copy above code and paste the code inside the content box
Step:6. Now save and view your blog.

কোন মন্তব্য নেই:

Popular Posts