Shortcodes in event-excerpt

Home Forums Calendar Products Events Calendar PRO Shortcodes in event-excerpt

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1264768
    Simon
    Participant

    We want to use a AJAX-plugin-shortcode inside the excerpts of the events. Since WP is stripping away any tags and shortcodes from the excerpt field by default, we already added the following to the functions.php file:

    add_filter( 'post_excerpt', 'do_shortcode');
    apply_filters('post_excerpt', $p->post_excerpt);

    This does not seem to affect the excerpts of the events. Is there a solution to make shortcodes work inside the excerpts of the events?

    #1266406
    Geoff B.
    Member

    Good evening Simon and welcome back!

    Thank you for reaching out to us.
    I would love to help you with this topic.

    I believe you might be interested in the following blog post: https://theeventscalendar.com/the-trouble-with-excerpts/

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1268711
    Simon
    Participant

    This reply is private.

    #1269261
    Geoff B.
    Member

    This reply is private.

    #1271011
    Simon
    Participant

    This reply is private.

    #1271439
    Geoff B.
    Member

    Good evening Simon,

    I am sorry the suggested filter did not help.

    I will ask our code ninjas to see if they have any further suggestions.

    But, perhaps, you might want to use custom fields for that purpose instead ?

    In other words, if you added a custom field containing the shortcode AND displayed that custom field (do_shorcode) in lieu of the excerpt IF not empty, I believe you will reach your goal.

    You might want to read our Themer’s guide to get a sense of how to customize the different views.

    Hang in there as I follow up on this for you.

    Best regards,

    Geoff B.

     

    #1271668
    Geoff B.
    Member

    Good morning Simon,

    I have good news.

    I believe the following filter works add_filter( 'tribe_events_excerpt_allow_shortcode', '__return_true' );

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1271772
    Mathew
    Participant

    There’s two filters that come into play. One allows it and one removes it. Here’s an article on both.

    Hope this helps.

    #1272203
    Geoff B.
    Member

    Thank you Mathew,

    You are absolutely right. There is a possible second filter.

    Cheers everybody,
    Geoff B.

    #1272593
    Simon
    Participant

    Thank you Mathew

    These two filters are the solution!

    Have a great weeekend.

    #1272720
    Geoff B.
    Member

    Good afternoon Simon,

    I am super stoked that this worked for you.

    You are welcome back in our support forums any time 🙂

    For now, I am going to close this thread.

    Have a good weekend,

    Geoff B.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Shortcodes in event-excerpt’ is closed to new replies.