Trying to add sorting to Webflow websites


I am trying to add sorting to webflow website. I have add the sricpt:

// 1) Connecting MixItUp JS library using public CDN link"

// 2) Reusable function to convert any string/text to css-friendly format
var conv = function (str) {
if (!str) {
str = ‘empty’;
} return str.replace(/[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g, ‘’)
.replace(/ /g, “-”)

// 4) Creating custom data-date attributes from blog dates:
var sortArray = document.querySelectorAll(‘.w-dyn-item .sort-category’);
sortArray.forEach( function(sortElem) {
var sortText = sortElem.innerText || sortElem.innerContent;
sortElem.closest(“.mix”).setAttribute(‘data-date’, sortText);

// 5) Set the reference to the container. Use the class-name of your Collection List or ID of the Collection List
var containerEl = document.querySelector(‘.posts-collection-list’);

// 6) Call the MixitUp plugin

Still it is not working. Please suggest.