( function( $ ) { var portfolioMedia, entryContent; $( '.portfolio-content' ).after( '
' ); portfolioMedia = $( '.portfolio-media' ); entryContent = $( '.entry-content' ); entryContent.find( '.jetpack-video-wrapper, .jetpack-slideshow, .tiled-gallery, .gallery, iframe' ).each( function() { $( this ).appendTo( portfolioMedia ); } ); entryContent.find( 'img' ).closest( 'p, figure' ).each( function() { $( this ).appendTo( portfolioMedia ); } ); } )( jQuery );