Hello,
Thanks to your response, I was able to generate the number dynamically by using .attr and use it as my CSS content value for the pseudo element.
Here’s the JS/jQuery code I use:
jQuery(document).ready(function($){
var num = 0;
$(.post-entry-521 .grid-sort-container .post-entry").each(function(){
num +=1;
$(this).attr('data-number',num);
});
});
And the CSS for the ::before
.post-entry-521 .grid-sort-container .post-entry::before {
content: attr(data-number);
}
Hope this help somebody in the future.