Restrict number of words in "preview" on front page shortcode

Home Forums Calendar Products Events Calendar PRO Restrict number of words in "preview" on front page shortcode

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1198872
    richwall
    Participant

    Hi

    I am using the shortcode on the front page of my site

    [tribe_events view=”photo” tribe-bar=”false”]

    to display a preview of the events on our front page.

    Is there additional shortcode “code” to restrict the number of words in teh preview to say – 20 words?

    Cheers

    Rich

    #1199438
    Andras
    Keymaster

    Hello Rich,

    Super question you have there!

    Unfortunately it is not possible to limit the number or words with the shortcode.

    You might be able to do that with a template override, which would also override the original photo view as well.

    To get started I recommend these 2 articles:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    https://theeventscalendar.com/knowledgebase/template-overview/

    Once you read through those,  you will need to create an override for this file:

    wp-content\plugins\events-calendar-pro\src\views\pro\photo\single-event.php

    and copy it to:

    wp-content/[your-theme]/tribe-events/pro/photo/single_event.php

    You will need to modify line 52, which says:

    <?php echo tribe_events_get_the_excerpt() ?>

     

    One other solution might be running tribe_events_get_the_excerpt through a filter.

    I hope this helps, let me know.

    Cheers,
    Andras

    #1208918
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Restrict number of words in "preview" on front page shortcode’ is closed to new replies.