Advertisement
fauzanjeg

JKIT || Redirect After Click Portfolio in Portfolio Gallery Widgets

Mar 5th, 2024
1,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Redirect After Click Portfolio in Portfolio Gallery Widgets
  3.  */
  4. function redirect_after_click_portfolio() {
  5.     ?>
  6.     <script type="text/javascript">
  7.         (function ($) {
  8.             $(document).on('ready', () => {
  9.                 const portfolio = $('.jkit-portfolio-gallery .row-item');
  10.  
  11.                 portfolio.on({
  12.                     click: (e) => {
  13.                         const url = $(e.target).closest('.row-item').find('.row-item-more a').attr('href');
  14.  
  15.                         window.location.href = url;
  16.                     }
  17.                 })
  18.             })
  19.         })(jQuery)
  20.     </script>
  21.     <?php
  22. }
  23. add_action( 'wp_footer', 'redirect_after_click_portfolio' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement