Tiggles ツ of Speak Creative
11/28/2018 - 5:41 PM

blog-tag-as-title.js

This will grab the url of the blog, and set it as the page header

      /* ==========================================================================
      blog titles by category 
      ========================================================================== */
      var parts = window.location.href.split('/'); //this grabs the url and splits it by slash
      var result = parts[parts.length - 1]; // this takes that last slashed bit
      result = result.replace(/-/g, ' '); //this removes the dashes from text
      $('.inner-hero h1').text(result); //this takes that content and replaces the text in this jquery w the result