• Hello,

    i’ve add a lightbox effect to default wordpress gallery using this code:

    /*----------------------
    FUNZIONI PERSONALIZZATE
    ----------------------*/
    
    // Remove Gallery Styling
    add_filter( 'gallery_style', 'my_gallery_style', 99 );
    
    function my_gallery_style() {
        return "
    ";
    }
    
    add_filter( 'use_default_gallery_style', '__return_false' );
    
    /* ---------------------
    AGGIUNGRE ATTRIBUTO LIGHTBOX
    -----------------------*/
    
    // Init Lightbox on Gallery Elements
    add_action( 'wp_print_footer_scripts', 'add_lightbox_to_wp_gallery' );
    function add_lightbox_to_wp_gallery() {
    
    echo '
     <script type="text/javascript">
      /* <![CDATA[ */
      jQuery(document).ready(function($) {
       $(".gallery-icon a").attr("data-lightbox","my-gallery");
      });
     /* ]]> */
    </script>';
    }

    And add to header.php the script of Lightbox js plugin. Now i like to custom the style of wordpress gallery to have less space between the colum (now i use 3 columns) and custom visual of gallery.

    I like to have this effect https://www.dropbox.com/s/up3xipl1fdf3o6g/esempio.jpg?dl=0 how can i do?

  • The topic ‘Custom Gallery Style’ is closed to new replies.