Advertisement
Petra1999

Tag Script | cloudythms.tumblr.com

Jul 9th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.23 KB | None | 0 0
  1. // ~~~ STEP 1.
  2. //     Locate the tag code in your theme. You can use Ctrl+F to search for "{Tag}"
  3. //     It could look something like this:
  4.  
  5. <div class="tags">
  6. {block:Tags}<a href="{TagUrl}">#{Tag}</a>{/block:Tags}
  7. </div>
  8.  
  9. //     Now you want to add the following code to the element around {Tag}:
  10.  
  11. class="t t-{URLSafeTag}"
  12.  
  13. //     In this case it would look like this:
  14.  
  15. <div class="tags">
  16. {block:Tags}<a href="{TagUrl}" class="t t-{URLSafeTag}">#{Tag}</a>{/block:Tags}
  17. </div>
  18.  
  19. //     If the element around {Tag} already has a class, for example like this:
  20.        <a ... class="tag">#{Tag}</a>
  21. //     then just add a space ( ) and t t-{URLSafeTag} after it, like this:
  22.        <a ... class="tag t t-{URLSafeTag}">#{Tag}</a>
  23.  
  24.  
  25.  
  26.  
  27. // ~~~ STEP 2.
  28. //     Paste the following code before </head>
  29. //     (Again: you can use Ctrl+F to search for </head> )
  30.  
  31. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  32. <!-- tag whitelisting/blacklisting by cloudythms -->
  33. <script src="https://static.tumblr.com/tpbx7ye/jYApceqxp/tagmanagecloudythms.js"></script>
  34. <script>
  35. $(document).ready(function(){
  36.    $(".t").tagManage("blacklist", /* blacklist or whitelist */
  37.    [
  38.             "example",
  39.             "example tag",
  40.             "example*tag",
  41.             "example!tag",
  42.             "example?tag",
  43.             "example.tag",
  44.             "example(tag",
  45.             "example)tag",
  46.             "example;tag",
  47.             "example+tag",
  48.             "example&tag",
  49.             "example\"tag",
  50.             "example'tag"
  51.            
  52.         /* enter your tags here like you would on a tumblr post
  53.            (without #, but with all special characters you use).
  54.            put them into quoatation marks ("") and
  55.            add a comma (,) after each one, except the last one.
  56.        
  57.            if you have tags that include " put a backslash before:
  58.               example"tag" ---> example\"tag\"
  59.            all other special characters should work fine.
  60.         */
  61.            
  62.     ]);
  63. });
  64. </script>
  65.  
  66.  
  67.  
  68.  
  69. // ~~~ STEP 3.
  70. //     If you want to whitelist tags instead of blacklist them,
  71. //     just change "blacklist" to "whitelist".
  72. //     Now just follow the instructions in the code for adding your tags!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement