Hi there,
Hope you can help. This is regarding custom code for my CMS “Blog post template”
I am trying to randomize my suggested CMS-blog posst, so the suggested blog posts underneath the blog currently being read are randomly picked instead of being the last 3 posts.
I used custom code I found in a guide, but unfortunaly it is not working. I suspect it is due to the class I am using.
<!-- Add to closing body -->
<script>
$.fn.shuffle = function() {
$.each(this.get(), function(index, el) {
var $el = $(el);
var $find = $el.children();
var i = $find.length, k , temp;
while(--i > 0) {
k = Math.floor(Math.random() * (i+1));
temp = $find[k];
$find[k] = $find[i];
$find[i] = temp;
}
$el.empty();
$find.appendTo($el);
});
};
$( document ).ready(function() {
$(".related-blogpost-list-2").shuffle();
});
</script>
Here is my site Read-Only: [Webflow - Under Åben Himmel][1]
([how to share your site Read-Only link][2])