Viewing 2 replies - 1 through 2 (of 2 total)
  • 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”>

    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-140×140.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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘resize images’ is closed to new replies.