Simple Staff List
resize images (3 posts)

  1. piskvorky
    Posted 2 years 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?


  2. lothsun
    Posted 2 years 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
    Posted 2 years 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() );


    $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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Staff List
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.