Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. if ( $captiontag && trim($attachment->post_excerpt) ) {
  2. $output .= "
  3. <{$captiontag} class='wp-caption-text gallery-caption'>
  4. " . wptexturize($attachment->post_excerpt) . "
  5. </{$captiontag}>";
  6. }
  7.  
  8. function modified_gallery_shortcode( $attr ) {
  9.  
  10. $attr['size'] = "thumbnail";
  11. $attr['link'] = "file";
  12. $attr['itemtag'] = "";
  13. $attr['icontag'] = "";
  14. $attr['captiontag'] = "";
  15. $output = gallery_shortcode( $attr );
  16. $output = strip_tags( $output, '<a><img><li><p>' );
  17. $from = array(
  18. "class='gallery-item'",
  19. "class='gallery-icon landscape'",
  20. "a href=",
  21. "class='wp-caption-text gallery-caption'"
  22. );
  23. $to = array(
  24. "",
  25. "",
  26. "a class="swipebox" rel="group" href=",
  27. "",
  28. );
  29. $output = str_replace( $from, $to, $output );
  30. $output = sprintf( '<div class="gallery">%s</div>', $output );
  31. return $output;
  32. }
  33.  
  34. add_shortcode( 'gallery', 'modified_gallery_shortcode' );
  35.  
  36. ( function( $ ) {
  37. function function_name() {
  38. $( '.gallery-caption').css({display:'none'});
  39. }
  40.  
  41. function_name();
  42. } )( jQuery );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement