EduardET

Blog module :: Image on the left + content on the right

Feb 27th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         function changeLayout() {
  5.             var blogModule = $( '.wpc-blog' );
  6.             if ( blogModule.length ) {
  7.                 var artcile = $( '.et_pb_posts.wpc-blog article' );
  8.                 artcile.each( function() {
  9.                     var featuredImage = $( this ).find( '.entry-featured-image-url' ),
  10.                         articleElements = $( this ).find( '.entry-title, .post-content, .post-meta' );
  11.                     $( this ).addClass( 'clearfix' );
  12.                     featuredImage.wrap( '<div class="wpc-left-box"></div>' );
  13.                     articleElements.wrapAll( "<div class='wpc-right-box'></div>" );
  14.                 } )
  15.             }
  16.         }
  17.         changeLayout();
  18.         $( document ).ajaxSuccess(function() {
  19.             changeLayout()
  20.         });
  21.     } );
  22. } )( jQuery );
  23. </script>
Advertisement
Add Comment
Please, Sign In to add comment