WordPress.org

Ready to get started?Download WordPress

Forums

Gallery
[resolved] album-thumb and photo-thumb doesn't seem to work (2 posts)

  1. webheadllc
    Member
    Posted 1 year ago #

    Hi,

    This is a great plugin, but I noticed my pages were loading the full size images on the galleries. Looking through the code it seems like the image sizes are only added on the admin side. I added the following to my theme and regenerated thumbnails and the correct image sizes are now used on the gallery and gallery-single templates.

    function wh_setup() {
        // get options from the database
        if ( 1 == $wpmu )
         $gllr_options = get_site_option( 'gllr_options' ); // get options from the database
        else
         $gllr_options = get_option( 'gllr_options' );// get options from the database
    
        if ( !empty($gllr_options) && !empty( $gllr_options['gllr_custom_size_px'] ) ) {
            add_image_size( 'album-thumb', $gllr_options['gllr_custom_size_px'][0][0], $gllr_options['gllr_custom_size_px'][0][1], true );
            add_image_size( 'photo-thumb', $gllr_options['gllr_custom_size_px'][1][0], $gllr_options['gllr_custom_size_px'][1][1], true );
        }
    }
    endif;
    add_action( 'after_setup_theme', 'wh_setup' );

    http://wordpress.org/plugins/gallery-plugin/

  2. bestwebsoft
    Member
    Plugin Author

    Posted 11 months ago #

    Hello webheadllc,

    Perhaps, you initially had some errors when you installed plugin and necessary data didn't come to the database.
    We will note this but in the future versions.
    We are happy that you solved this problem.

    Kind regards,
    Support Team

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic