WordPress.org

Ready to get started?Download WordPress

Forums

Simple Staff List
Thumbnail rather than full image? (10 posts)

  1. mpmchugh
    Member
    Posted 1 year ago #

    Is there a way to pull the thumbnail rather than the large image?

    -m

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

  2. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Not as of yet, unfortunately. I know it's not the ideal solution, but you can just scale the image down with CSS.

    Or if you feel comfortable editing the plugin's php file, I can let you know where to make the edits to allow it. And then I'll include this feature in the next release, I should have had it in there anyway. :)

    Thanks!
    Brett

  3. mpmchugh
    Member
    Posted 1 year ago #

    Sure. I can add php if you let me know what to add.

    Thanks!

    -Michael

  4. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Alright, here we go. Swap out the code here: http://pastebin.com/BexT5HBj for the user-view-show-staff-list.php and use this shortcode: [simple-staff-list image_thumbnail="yes"]

  5. Julie Kuehl
    Member
    Posted 1 year ago #

    I'll add my voice to requesting this as a future feature.

  6. haleeben
    Member
    Posted 1 year ago #

    I'll +1 for adding this to the next release.

  7. haleeben
    Member
    Posted 1 year ago #

    Hey Brett

    is this if statement working

    if(has_post_thumbnail()){
    
                    $photo_url = wp_get_attachment_image_src( get_post_thumbnail_id(), $image_size );
                    $photo_url = $photo_url[0];
                    $photo = '<img class="staff-member-photo" src="'.$photo_url.'" alt = "'.$title.'">';
                }else{
                    $photo_url = '';
                    $photo = '';
                }

    cause even if the staff member doesn't have an image it still outputs
    an <img> tag but without the src.

  8. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Note taken...I'll be adding this feature. :)

    @haleeben: Yes, it does work. What's probably happening is that you are manually using <img class="staff-member-photo" src="[staff-photo-url]" alt="[staff-name] : [staff-position]"> or something similar in your Staff Loop. I have it this way in the default Staff Loop to demonstrate a usage case for wanting to use the [staff-photo-url] vs. just [staff-photo], which does not echo anything if there is no post thumbnail.

  9. haleeben
    Member
    Posted 1 year ago #

    Hey Brett

    Yeah that was it, I hadn't changed the default template, thanks for the help.

  10. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    No problem!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.