Quirky title emphasis idea w/ Regex and JQuery Selectors

Posted by in Uncategorized

  This was a surprisingly easy little project I set myself on a snotty-nosed day of being a winter hermit – a simple way to add emphasis to titles by changing the font of the text preceding a string’s first colon. Here, I was working with WordPress as my platform, but of course this can be applied to anything HTML/CSS/JS, and was adapted from this JSFiddle. yourjavascriptfile.js $(document).ready(function() {  $(‘.blog-title’).html(function(i, h){   return h.replace(/^([^:]*)\:/, ‘$&’);  }); }); Where .blog-title is the CSS Selector for your chosen title. In my case, my…read more