(function($) {if($('.new-comment').length > 0) { var time = function(c) { return parseInt(jQuery(c).find('.comment-date').attr('time')); }; var new_comments = $('.new-comment').sort(function(a, b) { return time(b) - time(a); }); $('.realcomment').after(new_comments); }})(jQuery);
This should work. I put the newest ones first, but you can switch that by changing
time(b) - time(a)
to
time(a) - time(b)
This should work. I put the newest ones first, but you can switch that by changing
to