EduardET

Swap Project name and Project category

Dec 20th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         $.fn.swapWith = function( that ) {
  5.             var $this = this;
  6.             var $that = $( that );
  7.  
  8.             // create temporary placeholder
  9.             var $temp = $( "<div>" );
  10.  
  11.             // 3-step swap
  12.             $this.before( $temp );
  13.             $that.before( $this );
  14.             $temp.after( $that ).remove();
  15.  
  16.             return $this;
  17.         }
  18.         var project = $( ".wpc-portfolio .et_pb_portfolio_item" );
  19.         project.each( function() {
  20.             var title = $( this ).find( ".et_pb_module_header" ),
  21.                 meta = $( this ).find( ".post-meta" );
  22.             $( title ).swapWith( meta );
  23.  
  24.         } )
  25.     } );
  26. } )( jQuery );
  27. </script>
Advertisement
Add Comment
Please, Sign In to add comment