...and paste the following code just before the </body> tag, and save the template.
<!-- Start post reversal code -->
<script type='text/javascript'>
var Blog1 = document.getElementById('Blog1');
var postContainer = Blog1.childNodes[1];
var first = postContainer.firstChild;
var status = null;
var child = first.nextSibling;
var childNext = null;
var classes = '';
var dateHeaders = false;
while (child != null) {
if (child.className == 'date-header') {
dateHeaders = true;
}
if (child.className == 'status-msg-wrap') {
status = child;
}
child = child.nextSibling;
}
child = first.nextSibling;
while (child != null) {
if (child.className != null) {
if (child.className.match('date-header') != null) {
childNext = child.nextSibling;
postContainer.insertBefore(child, first);
first = child;
child = childNext;
} else if (child.className.match('post hentry') != null) {
childNext = child.nextSibling;
if (!dateHeaders) {
postContainer.insertBefore(child, first);
first = child;
} else {
postContainer.insertBefore(child, first.nextSibling);
}
child = childNext;
} else {
child = child.nextSibling;
}
} else {
child = child.nextSibling;
}
}
if (status != null) {
postContainer.insertBefore(status, first);
}
</script>
<!-- End post reversal code -->
That's it! You're done!
Dude. You rock. It so works.
ReplyDeleteIt works on mozilla, but not for internet explorer...
ReplyDeleteAny ideas to correct this, please?
Yes, it works on Firefox but not in IE6
ReplyDeleteIt didn't work on explorer...
ReplyDeleteit wouldnt work at first in safari when i tried to edit it there, but if you edit it in another browser and save it there, it'll last when you switch back to your favourite browser.
ReplyDeleteThis is SO GREAT. Thank you! You're a genius.
ReplyDeleteI have tried this both on Safari & Firefox several
ReplyDeletetimes no joy yet. Can anyone think what I might be doing wrong?
Doesn't work in Firefox 3.6
ReplyDeleteDidn't work with IE8. I'm crying! Any help out there????
ReplyDeleteI am using Google Chrome. Is that why it isn't working?
ReplyDeleteIt didn't work for me :( I might have done something wrong but it seems easy and my posts are still in reverse order.
ReplyDeleteThis example doesn't work in Chrome or IE8, so it's not a general solution. It would be so easy for these blogging sites to offer a "reverse" facility, why should we have to mess around with script.
ReplyDeleteDidn't work in Firefox 12.0. Any other ideas?
ReplyDeleteIt seems the HTML editor doesn't like apostrophes, and changes them to ' when I try to copy and paste it into it. Even when I change the ' to apostrophes and save it, and then go back to it, it changes them back to '. Anyone have the same problem?
ReplyDeleteWhoops when I typed & # 3 9 ; (remove the spaces between the 5 characters) it auto corrected to an apostrophe. Here's what I meant to say:
ReplyDeleteIt seems the HTML editor doesn't like apostrophes, and changes them to & # 3 9 ; when I try to copy and paste it into it. Even when I change the & # 3 9 ; to apostrophes and save it, and then go back to it, it changes them back to & # 3 9 ;. Anyone have the same problem?