How to get article image to appear in events listing

Home Forums Calendar Products Events Calendar PRO How to get article image to appear in events listing

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #15048
    Stefan
    Member

    Hi,
    in the listing of events, instead of calendar view – is it possible to display the thumbnails of the image that WP let me set as “article image”? (On the page where an event is edited at the lower right.) Right now, only images put directly into the body of the event appear in the listing.

    thanks,
    Stefan

    #15076
    Rob
    Member

    Hi Stefan. Interesting request; I’m trying to visualize what it is you’re going for here. Do you have another site where you saw this that you could share? Doesn’t sound like it’s doable out of the box but I’d be interested in hearing more to see if something along these lines may be worth incorporating down the road.

    #15347
    Stefan
    Member

    What I mean is that the input page allows for an “article image” to be set for an event, and now I was wondering if that can be displayed, for instance when all the events are listed off.

    #15361
    Rob
    Member

    Ah, gotcha. You just want the featured image to show in list view. (Correct me if I’m wrong there). Otherwise let me see if Jonah, our dev, has any ideas regarding pointing you in the right direction when he hits the forums next.

    #15376
    Stefan
    Member

    Yep, that’s it. Is there an option for it that I overlooked?

    #15434
    Rob
    Member

    Nope, it’s going to require some configuration. Jonah has been out for the holiday weekend but should be back in full swing tomorrow, so he’ll be taking a look accordingly from there. Apologies for the delay thus far.

    #15487
    Jonah
    Participant

    Hey Stephan, you just need to add the code to display the featured image to the list template and it’s not that difficult. First make a duplicate copy of /wp-content/plugins/the-events-calendar/views/list.php and place in an ‘events’ folder in your theme. This will let you make changes to it and keep them safe from updates. Next, simply paste in the following code:


    if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
    the_post_thumbnail();
    }

    …wherever you want the thumbnail to display. You can wrap it in a div and style it or if you want to get really fancy run it through TimThumb for some on the fly resizing and processing.

    I hope that helps!

    – Jonah

    #15615
    Stefan
    Member

    That works perfectly. Thank you!

    #15661
    Rob
    Member

    Excellent! Thanks for confirming, Stefan – glad to see that did the trick. Let us know what else you need down the road as you keep working with this plugin.

    #975767
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘How to get article image to appear in events listing’ is closed to new replies.