Event image in photo view (tribe_event_featured_image) doesn't have width/height

Home Forums Calendar Products Events Calendar PRO Event image in photo view (tribe_event_featured_image) doesn't have width/height

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #130969
    Justin
    Participant

    Looking at the source, it seems the tribe_event_featured_image included in the photo view for upcoming events doesn’t include width and height parameters in the [img] tag. I assume this is because of the use of masonry and the desire to have the images adapt to available space.

    In my case, the masonry grid is fixed, so blocks will always be the same size. Is there a way to force the image element returned by this tag to include the width & height parameters? Looking to avoid some page flow problems I’m encountering using a lazy load image script to speed up page load time.

    #131258
    Barry
    Member

    Yeah that’s definitely possible and there are a few ways you might tackle this. One way, though slightly crude, would be to add attributes via string manipulation – here’s one such example (which you might add to your theme’s functions.php file).

    Beyond that, you could remove the tribe_event_featured_image() call from the pro/photo/single-event.php template and replace it with custom code built around WordPress’s own featured image template tags (which our own function is simply a wrapper around).

    Does that help?

    #131263
    Justin
    Participant

    Great, thanks. I’ll give these a shot. Didn’t know your function was a wrapper for the default image call, so that helps a lot.

    #135114
    Barry
    Member

    No problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Event image in photo view (tribe_event_featured_image) doesn't have width/height’ is closed to new replies.