How do I change the number of characters (or words) in the abstract?

Home Forums Calendar Products Events Calendar PRO How do I change the number of characters (or words) in the abstract?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1011325
    fifteen15studios
    Participant

    I would like to know how to change the number of characters (or words) in the abstract of the events listing. How do I do this? I’m talking about the length of the summary presented underneath each event listing, primarily in list mode, which gives a briefing of the text in the main event description.

    Thanks!
    Brendan

    #1011569
    Nico
    Member

    Hi Brendan,

    Glad to help you out here too!

    The event description for the listing is generated with the_excerpt function. As the function documentation notes, you change change the excerpt length by adding this snippet to your functions.php file -located at wp-content/themes/your_theme/-:


    function custom_excerpt_length( $length ) {
    return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    Another way to go is to create a template override for the the-events-calendar\src\views\list\single-event.php template as I just described in the other thread you opened: http://theeventscalendar.com/support/forums/topic/where-do-i-edit-the-html-which-displays-the-events-for-the-list-view/

    Please let me know if this answers your question,
    Best,
    Nico

    #1011730
    fifteen15studios
    Participant

    That covers it. Thanks! But what do the ’20’ and the ‘999’ represent?

    Thanks,
    Brendan

    #1011899
    Nico
    Member

    Hey Brendan,

    Glad to hear this made the trick here 🙂

    The ’20’ is the new length for the excerpt – you can change that to fit your needs. While the ‘999’ specifies the order in which this filter will be executed – kinda technically thing. If you are interested you can read more about it here: https://codex.wordpress.org/Function_Reference/add_filter

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How do I change the number of characters (or words) in the abstract?’ is closed to new replies.