Home › Forums › Calendar Products › Events Calendar PRO › Shortcodes in event-excerpt
- This topic has 11 replies, 3 voices, and was last updated 8 years, 11 months ago by
Simon.
-
AuthorPosts
-
April 5, 2017 at 2:58 am #1264768
Simon
ParticipantWe 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?
April 6, 2017 at 9:38 pm #1266406Geoff B.
MemberGood 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.
April 12, 2017 at 2:08 am #1268711Simon
ParticipantThis reply is private.
April 12, 2017 at 8:19 pm #1269261Geoff B.
MemberThis reply is private.
April 18, 2017 at 2:09 am #1271011Simon
ParticipantThis reply is private.
April 18, 2017 at 8:22 pm #1271439Geoff B.
MemberGood 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.
April 19, 2017 at 9:14 am #1271668Geoff B.
MemberGood 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.April 19, 2017 at 10:30 am #1271772Mathew
ParticipantThere’s two filters that come into play. One allows it and one removes it. Here’s an article on both.
Hope this helps.
April 20, 2017 at 8:48 am #1272203Geoff B.
MemberThank you Mathew,
You are absolutely right. There is a possible second filter.
Cheers everybody,
Geoff B.April 21, 2017 at 5:04 am #1272593Simon
ParticipantThank you Mathew
These two filters are the solution!
Have a great weeekend.
April 21, 2017 at 9:16 am #1272720Geoff B.
MemberGood 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.
-
AuthorPosts
- The topic ‘Shortcodes in event-excerpt’ is closed to new replies.
