WordPress.org

Ready to get started?Download WordPress

Forums

Eazyest Gallery
[resolved] Classes and output markup for gallery thumbnails (5 posts)

  1. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    Is there any way to add custom classes to gallery and
    to the thumbnail's captions?

    The reason is that some CSS frameworks have their own set of classes.
    Eg, for 4 columns thumbnails grid Foundation uses .large-block-grid-4.

    (http://foundation.zurb.com/docs/components/block-grid.html)

    <ul class="small-block-grid-2"> <!-- gallery_div -->
    <li> <!-- item--></li>
    <li> <!-- item--></li>
    </ul>

    http://wordpress.org/extend/plugins/eazyest-gallery/

  2. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    Managed to change the gallery_div markup with a filter.

    function kli_style_div() {
            $gallery_div = "<ul class="small-block-grid-2">"
            return $gallery_div;
    }
    add_filter( 'gallery_style', 'kli_style_div', 99 );
  3. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that's how it works.

  4. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    How to make Eazyest Gallery [gallery] output markup to be different from other [gallery] output?

    Can't find how to customize the gallery_div tag only for Eazyest Gallery.
    The eazyest_gallery_itemtag filter special for the plugin.
    So why not have a gallery_div tag special for the plugin?

    function kli_eazyest_gallery_itemtag() { return "li"; }
    add_filter("eazyest_gallery_itemtag", "kli_eazyest_gallery_itemtag",10,2);

    ps: The shortcode_atts_gallery filter has no effect for Eazyest Gallery.

    function kli_ezg_gallery_atts( $attr ) {
            $attr['itemtag'] = 'div';
            $attr['nolinkwrap'] = false; //custom
            return $attr;
    }
    add_filter( 'shortcode_atts_gallery', 'kli_ezg_gallery_atts',2099 );

    (using plugin v.0.1.RC14)

  5. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    You can check if you are displaying a galleryfolder post_type befrore you processs the filter.
    PS this filter is introduced in 3.6 the plugin does not support these new filters (yet)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic