List view strips HTML

Home Forums Calendar Products Events Calendar PRO List view strips HTML

  • This topic has 0 replies, 2 voices, and was last updated 6 years ago by Henk v d Velden.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1484611
    Henk v d Velden
    Participant

    List view strips HTML tags from event description excerpts, no matter which template settings I pick on Events > Settings > View. I would like to keep these tags, is that possible?
    Next to that, is there a way to change the length of these excerpts?

    #1486528
    Patricia
    Member

    Hey Henk,

    Thank you for reaching out to us!

    What is the HTML tag you are trying to add to your event description? If you add HTML tags via Visual editor, they won’t be removed.

    You can change the excerpt length by adding the following snippet in the end of your theme’s functions.php file:

    https://gist.github.com/nefeline/1d302462e9bb2891e87a226c1a775c6e

    In this example your excerpt length will be changed to 300.

    I hope this helps! If you have any other questions at all please feel free to let me know and I’d be happy to help as best I can!

    Cheers,

    Patricia

    #1486718
    Henk v d Velden
    Participant

    Hi Patricia,

    thanks, you code snippet does help to control the excerpt length. Nice!

    As for the other issue: the HTML tags are standard tags like <ul> and they are added using the Visual editor. However they are stripped from the excerpts. I tested this with all plugins deactivated and the default Twenty Seventeen theme activated, but even then the tags are removed from the excerpts. I’m afraid I still need some assistance on this one…

    Cheers,
    Henk

    #1489024
    Patricia
    Member

    Hi Henk,

    I’m glad to hear that the snippet worked as expected!

    Thanks for sending us more info about the ul tag that is being stripped from your Events List.

    I was able to reproduce the same in my local install: this is happening because The Events Calendar is using the wp_trim_words function to trim words and this is required for excerpts to work.

    The best solution you have right now is to use “manual” excerpts if you need to preserve HTML. You can do this by editing one of your events and adding the description in the “excerpt” metabox (screenshot here). In this example, you should be able to see the ul tags working as expected on list view (example here).

    I hope this helps!

    Cheers,

    Patricia

    #1509449
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘List view strips HTML’ is closed to new replies.