Search code examples
tumblr

Tumblr, get the current tag of the /tagged/nameoftag page


I am making a HTML theme but I need to grab the currently viewed tag, is this possible?

I tried {Tag} but it doesn't show up


Solution

  • Javascript solution

    <script type="text/javascript">
        var currentURL = document.URL;
        currentURL = currentURL.substring(currentURL.indexOf("tagged") + 7);    
        console.log('current', currentURL);
    </script>