WordPress.org

Ready to get started?Download WordPress

Forums

Simple Staff List
resize images (3 posts)

  1. piskvorky
    Member
    Posted 11 months ago #

    How does the Simple Staff Plugin cooperate with plugins for image resizing/thumbnails?

    For example, Simple Image Sizes plugin generates a multitude of images in different sizes, but Simple Staff Plugin always displays the original uploaded size, which doesn't make sense.

    How do I tell Simple Staff which size to use?

    http://wordpress.org/plugins/simple-staff-list/

  2. lothsun
    Member
    Posted 11 months ago #

    I took the image html and added the height and width attributes to it. So instead of it being:

    <img src="Image Url" alt="Name">

    It would be:

    `<img src="Image Url" alt="Name" width="Size" height="Size">

  3. gsbrock
    Member
    Posted 11 months ago #

    What lothsun said will modify the image size on the site, but it will still end up using the original image (image.jpg, for example) instead of a resized image (image-140x140.jpg).

    What I think piskvorky is asking about is a way to modify which thumnail size is chosen, similar to the second variable in get_the_post_thumbnail <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?>

    In theory this following modifications should work.

    In simple-staff-list/_inc/user-view-show-staff-list.php modify line 90 from

    $photo_url = wp_get_attachment_url( get_post_thumbnail_id() );

    to

    $photo_url = reset(wp_get_attachment_image_src( get_post_thumbnail_id(), 'staff-thumbnail' ));

    In your child theme's functions.php file add the following (modify the dimensions to fit your needs)

    add_image_size( 'staff-thumbnail', 140, 140, true );

    Additionally, if wordpress can't find the proper image size, it should fall back to the original automatically.

    Personally, this is a change I'd love to see added the the plugin permanently, as the modification to user-view-show-staff-list.php will be lost of the addon is updated.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.