• I’d like to use the data-big attribute for Galleria fullscreen mode. Galleria supports this out of the box but I’m not a PHP expert, so I don’t seem to be able to make it work without a little help how to do this the WordPress way.
    I’m pretty sure it’s not too hard as the only thing needed would be to add an attribute to the image output

    <div class="galleria">
        <a href="/img/large1.jpg"><img src="/img/thumb1.jpg" data-big="/img/big1.jpg" data-title="My title" data-description="My description"></a>
        <a href="/img/large2.jpg"><img src="/img/thumb2.jpg" data-big="/img/big2.jpg" data-title="Another title" data-description="My <em>HTML</em> description"></a>
    </div>

    (Source: “You may also add a separate larger image for fullscreen using the data-big attribute“)

    Something like this didn’t sem to work:

    function gallery_add_src_attributes($attr) {
    
        $imgsrc = wp_get_attachment_image_src( $post_id, 'full' );
        $attr['data-big'] = $imgsrc;
    
        return $attr;
    }
    
    add_filter( 'wp_get_attachment_image_attributes', 'gallery_add_src_attributes', 10, 3 );

    Any suggestions or pointers? Thanks in advance.

    https://wordpress.org/plugins/marctv-galleria/

  • The topic ‘data-big atribute’ is closed to new replies.