Excerpt length for event description on the events list

Home Forums Calendar Products Events Calendar PRO Excerpt length for event description on the events list

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26015
    Jean
    Participant

    Hi, how can you set an excerpt length so that if the event description of the event posted exceeds the excerpt length it automatically adds the (more…) button instead of me having to inset a read more shortcode everytime.

    #26024
    Jonah
    Participant

    Hi Jean,

    In order to do this I would suggest using another plugin like http://wordpress.org/extend/plugins/advanced-excerpt/ – once installed you’ll need to then modify /wp-content/plugins/the-events-calendar/views/list.php by making a copy and placing in an events folder in your active theme and replacing the_excerpt() with the Advanced Excerpt function.

    I hope that helps.

    Regards,
    Jonah

    #26039
    Jean
    Participant

    That plugin doesn’t work, this one does
    http://wordpress.org/extend/plugins/auto-excerpt-everywhere/

    however it changes the font size of the whole calendar/events for some reason?

    not sure if it has to do with the calendar/events plugin? or the excerpt plugin but I asked the author of the plugin as well.

    #26041
    Jonah
    Participant

    Hi Jean,

    It’s probably cutting a tag off somewhere midway. You’ll need to figure out some way to strip any tags except for the essentials in the excerpt. I’ve got a handy function I use in projects myself: https://gist.github.com/3828701 – pop that in your themes functions.php file and then you can use it like so:

    echo restoreTags(trunc(strip_tags(get_the_content(), ''),12));

    The tags in parenthesis are the allowed tags and 12 is the number of words you want to use. You might have to take out some of those tags… See if that works…

    – Jonah

    #26042
    Jonah
    Participant

    Ooops, some code got stripped out. Try this: http://snippi.com/s/yvycxan

    #26049
    Jean
    Participant

    Hi Jonah,
    after putting https://gist.github.com/3828701 in to functions.php
    where/how should I use this code http://snippi.com/s/yvycxan you provided?
    thanks.

    #26059
    Jonah
    Participant

    Hi Jean,

    You would use that in list.php or wherever else you want to display the excerpt of a post instead of the full thing.

    – Jonah

    #26066
    Jean
    Participant

    Hi, Jonah
    everything is working, but the font sizes still change as you can see here http://toronto.plalendar.com/events/upcoming/

    and another thing is with the excerpt it gets rid of the Social Sharing Buttons which I don’t mind as long as it can be all removed or all there, rather than some events having it and some not. Any suggestions? thank you in advance.

    #26104
    Jonah
    Participant

    Hi Jean,

    The font sizes look ok to me. Do you have some specific examples? You will need to figure out the social sharing buttons yourself. It’s likely you are automatically adding the buttons through whatever plugin you are using, so I would suggest turning that off and then manually including the buttons only where you need them.

    Regards,
    Jonah

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Excerpt length for event description on the events list’ is closed to new replies.