Code show time read for blogger
ViewsCode HTML
<span class='readingTime'> <svg class='icon read_time' viewBox='0 0 24 24'> <path d='M12 20C16.4 20 20 16.4 20 12S16.4 4 12 4 4 7.6 4 12 7.6 20 12 20M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12.5 12.8L7.7 15.6L7 14.2L11 11.9V7H12.5V12.8Z' fill=''></path> </svg> <span class='readTime' id='readTime'></span> </span>Code CSS
.readingTime .read_time { fill: #6eb056; } .readingTime svg { height: 19px; width: 19px; vertical-align: -5px; margin-right: 0.45rem; } .readingTime span { display: inline-block; vertical-align: middle; }Code Javascript
<script> /*<![CDATA[*/ function get_text(el) { ret = ""; var length = el.childNodes.length; for(var i = 0; i < length; i++) { var node = el.childNodes[i]; if(node.nodeType != 8) { ret += node.nodeType != 1 ? node.nodeValue : get_text(node); } } return ret; } var words = get_text(document.querySelector('.artbody')); var count = words.split(' ').length; var avg = 185; var counted = count / avg; var maincount = Math.round(counted); document.querySelector(".readTime").innerHTML = maincount + " min read"; /*]]>*/ </script>Change .artbody for get length text article