• Resolved blitz999

    (@blitz999)


    I’m getting a fatal error using the thumbnail size feature:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24576 bytes) in /Users/user/Sites/HSA2/wp-content/plugins/simple-staff-list/public/partials/simple-staff-list-shortcode-display.php on line 140
    
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /Users/user/Sites/HSA2/wp-content/plugins/woocommerce/includes/class-wc-logger.php on line 1
    [staff_loop]
    
    			<div class="staff-member-info-wrap">
    <img class="staff-member-photo" src="[simple-staff-list image_size=shop_thumbnail]" />
    				[staff-name-formatted]
    				[staff-position-formatted]
    [staff-twitter]
    				[staff-bio-formatted]
    				[staff-email-link]
    			</div>
    		[/staff_loop]

    This works, but the images are in original, random sizes:

    <img class="staff-member-photo" src="[staff-photo-url]" alt="[staff-name] : [staff-position]">

    One other display issue is that the Twitter field shows, even if no Twitter handle is entered. Ideally this would not display at all for those people without a Twitter account.

    Really fab otherwise. If you have any insight into the image issue, that’d be great. Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brett Shumaker

    (@brettshumaker)

    Hi @blitz999

    The memory issue is because you’ve used the Staff Member shortcode within your template, so the site is trying to display the staff list within the staff list, within the staff list and so on. Causing an infinite loop.

    To use a different image size, you need to use the [simple-staff-list image_size=shop_thumbnail] where ever you want to display your staff list and not within your Staff List template on the plugin’s “Templates” page.

    Hope this helps!

    Thread Starter blitz999

    (@blitz999)

    Hi Brett, thanks for the reply.

    Right, OK, got it, thanks! It’s working too ??

    Just the other little issue (happy to make a new topic if preferred). I have included the [staff-twitter] code in the template. This shows the full twitter link whether or not that person has an account. Ideally this field would not show if the user does not have a Twitter account as it is confusing.

    Ideally, I’d like to edit the link to simply show the @username and have this as a hyperlink and not have the full https://www.twitter.com/@username which displays. Is there a way to do this or create an editable template so I can make those changes?

    Plugin Author Brett Shumaker

    (@brettshumaker)

    Hi @blitz999
    Right now, unfortunately, my code isn’t displaying fields the way it should (i.e. not showing a field if it’s blank. So you’ll have to hide the urls with css using something like:

    .staff-member a[href="https://twitter.com/"] {
        display: none;
    }

    I know it’s not awesome, but it’ll change soon. Promise. ??

    Thanks again!

    • This reply was modified 7 years, 3 months ago by Brett Shumaker. Reason: code formatting
    Thread Starter blitz999

    (@blitz999)

    Hi Brett,
    Thanks again. I think I might look at the code tomorrow. I think the variables should be if isset to be conditional in this way? I’m not really a PHP coder (Designer!), but if I hack it, I’ll let you know! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Staff photo size’ is closed to new replies.