Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter missyklotz

    (@missyklotz)

    Figured it out for anyone who’s wondering. Changes the slideshow plugin so that you can choose one of your custom image sizes in the media uploader and then displays that custom image size in the slideshow.

    Replace ‘original’ in line 485 of shortcode.php to use your custom image name, this is what i changed it to:

    $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(),'slideshowphoto');

    Then in tonjoo_frs_admin.php I made these changes beginning at line 597:

    //Extend the wp.media object
            custom_uploader = wp.media.frames.file_frame = wp.media({
                title: 'Choose Image',
                button: {
                    text: 'Choose Image'
                },
                multiple: false,
                library: { type: "image" },
                frame: "post",
                state: "insert"
            });
    
            //When a file is selected, grab the URL and set it as the text field's value
            custom_uploader.on('insert', function() {
                attachment = custom_uploader.state().get('selection').first().toJSON();
                jQuery('[frs-mediauploader]').find('[media-upload-id]').val(attachment.id);
    
                //thumbnail =  attachment.url;
    
                jQuery('[frs-mediauploader]').find('[media-upload-image]').attr('src',attachment.sizes.slideshowphoto.url);
    
            });

    I know editing the theme’s files is not a good practice, but I’m trying to do this quickly for a client project and have ended up needing to do a lot of customization.

    Hi, I have the same issue, however I do not necessarily want to have ONE particular size added, rather would prefer the normal size selection dropdown in the media selector. Surely there must be a solution…
    Hence I would not call this resolved, rather special workaround. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Attachment Display Settings Choose Image Size’ is closed to new replies.