fauzanjeg

Custom element by Tag

Mar 26th, 2021 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.60 KB | None | 0 0
  1. /* Custom element by Tag */
  2. (function ($) {
  3.     $(document).ready(function () {
  4.         let tag = window.location.pathname; // Get Tag Name by Slug
  5.         tag = tag.split('/');
  6.         const list_tag = ['web-design', 'typography']; // List of Tag
  7.  
  8.        
  9.         if ( $.inArray( 'tag' , tag ) ) { // If Tag Archive
  10.             list_tag.forEach(list => {
  11.                 if ( $.inArray( list , tag ) > 0 ) {
  12.                     // insert your code here
  13.                     console.log('ok');
  14.                     $('.jeg_archive_title').find('span').text('THIS TITLE'); // Example Change Title
  15.                     $('.site-title img.jeg_logo_img').remove(); // Example Remove Logo
  16.                 }
  17.             });
  18.         }
  19.     });
  20. }(jQuery))
Add Comment
Please, Sign In to add comment