Event Organiser
Thumbnails and excerpts (3 posts)

  1. tombourdon
    Posted 3 years ago #

    First of all what a great plugin and your help on these forums seems to have helped many, so a big thanks.

    My question is 2 fold. Firstly is it possible to assign attributes to the %event_thumbnail% I´m trying to get it to alignleft so I can have the excerpt next to the thumbnail as opposed to below.

    The second part of my question is this, is there any way to change the length of the excerpts I´m using %event_excerpt% and it work fantasticly but there are just far too many characters for my needs.

    Thanks for your help in advance.



  2. Stephen Harris
    Plugin Author

    Posted 3 years ago #

    Hi Tom, glad you like it!

    The excerpt is trimmed using wp_trim_excerpt(), which cuts the excerpt to a certain length. This length can be altered using the filter excerpt_length to it, so the following should work (to change it to 500 say):

    function my_excerpt_length( $length ){
    return 500;

    Note: This determines the length of excerpts in your theme, so it will effect other things too! I'll looking into adding an attribute for the %event_excerpt% tag for specifying a length. You can expect this in 1.6.

    Similarly for the thumbnail you can use the wp_get_attachment_image_attributes filter. But again this will effect all thumbnails. Inside that call back you might be able to use $post_id = get_the_ID() to get the ID of the post, and get_post_type($post_id) to get its type (and so only change it if its an event).

    Again, I'll look into adding the attribute to the tag for 1.6.

  3. Stephen Harris
    Plugin Author

    Posted 3 years ago #

    I'll be making these changes in 1.6:

    %event_thumbnail% will take two optional arguments. The first is the size of the thumbnail, the second is passed as the $attr argument in get_the_post_thumbnail (http://queryposts.com/function/get_the_post_thumbnail/).


    //(event thumbnail, default size: 'thumbnail')
    //(event thumbnail, size: 'large')
    //(event thumbnail, size: 'large', with class 'custom-class', alt text 'alt-text' and title 'title'.

    %event_excerpt% will take an optional argument (an integer) to limit the excerpt (in characters). Default 55.

    %event_thumbnail% //limit excerpt by 55 characters
    %event_thumbnail{30}% //limit excerpt by 30 characters

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Event Organiser
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic