Home › Forums › Calendar Products › Events Calendar PRO › Excerpt length for event description on the events list
- This topic has 8 replies, 2 voices, and was last updated 11 years, 7 months ago by Jonah.
-
AuthorPosts
-
October 2, 2012 at 8:26 pm #26015JeanParticipant
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.
October 3, 2012 at 8:28 am #26024JonahParticipantHi 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,
JonahOctober 3, 2012 at 10:43 am #26039JeanParticipantThat 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.
October 3, 2012 at 11:13 am #26041JonahParticipantHi 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
October 3, 2012 at 11:13 am #26042JonahParticipantOoops, some code got stripped out. Try this: http://snippi.com/s/yvycxan
October 3, 2012 at 12:14 pm #26049JeanParticipantHi 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.October 3, 2012 at 6:34 pm #26059JonahParticipantHi 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
October 3, 2012 at 8:15 pm #26066JeanParticipantHi, 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.
October 4, 2012 at 1:31 pm #26104JonahParticipantHi 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 -
AuthorPosts
- The topic ‘Excerpt length for event description on the events list’ is closed to new replies.