Home › Forums › Calendar Products › Events Calendar PRO › Spacings, sections not in the List View
- This topic has 5 replies, 2 voices, and was last updated 8 years, 9 months ago by Barry.
-
AuthorPosts
-
July 21, 2015 at 2:02 am #988269MichaelParticipant
Hi,
I am sorry, but I have another one.
Pse look at this URL: http://goo.gl/cw8B3k
with the events.
Everything is written thru, with no sections or paragraphs. While on the single Day there are “break, sections” etc.?
Is it possible to:
1. format the text (bring a sentence start into the next line, etc.?)
2. show just the first couple of lines of the text in the list view and the complete text in the normal day view? E. G.
http://goo.gl/cw8B3k
So the “Programm” would not be shown in the List View: http://goo.gl/cw8B3kregards
MJuly 21, 2015 at 7:03 am #988342BarryMemberHi Michael,
By default, list view will uses the excerpt rather than the full description. If this is not explicitly set (just as with regular posts and pages, you can hand craft an excerpt if you would like to do so via the editor) then WordPress will load the description instead.
However, WordPress will also strip out formatting and shorten the text in such a case. If you wish to avoid this you can take one of two approaches:
- The first, as above, is simply to craft your own excerpt text
- The second is to modify the list/single-event.php template which you can do safely via a template override – and then just replace the_excerpt() with the_content()
Would either of those options work for you?
July 21, 2015 at 7:41 am #988388MichaelParticipantHi,
when I understand correct, there should be just an excerpt of the event description to be seen in the list view?
But – in this case the complete description is beeing seen in the list view? It is NOT shorten at all.
If – where could I find this setting?regards
MJuly 21, 2015 at 1:22 pm #988603BarryMemberHi!
But – in this case the complete description is beeing seen in the list view? It is NOT shorten at all.
Well, I don’t think that’s quite true.
If you look here, the description is relatively long and includes pieces of information under the heading “Programm” – whereas the same event in list view does not include this.
By default WordPress trims descriptions down to the first 55 words when it forms excerpts automatically — if as in some of your events the descriptions does not exceed that then they are not actually truncated (though formatting information is still removed).
If – where could I find this setting?
I’m afraid WordPress doesn’t provide a setting for this, but it is configurable through a short snippet (which you might add to your theme’s functions.php file):
function custom_excerpt_length() { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length' );
In the above example, excerpts will be truncated to 20 words if needed.
Does that help/clarify things?
July 22, 2015 at 1:30 am #988756MichaelParticipantHi Barry,
thx a lot.
And yes that clarifys everything to me.
I will work on that.Pse close!
regards
MJuly 22, 2015 at 7:03 am #988828BarryMemberThanks M — and good luck with the customizations 🙂
-
AuthorPosts
- The topic ‘Spacings, sections not in the List View’ is closed to new replies.