0

I'm using Timber on a WordPress site but am having an issue with shortcode content appearing on the homepage as html/text. I'm using {{ post_content|exceprt(30) }} to display the post content but this causes shortcodes to be displayed.

I'd prefer not to display any shortcode content at all on this page (either rendered or as html/text), if possible.

Is there any way to filter out shortcodes using Timber?

0

try adding the pipe stripshortcodes {{ post_content|exceprt(30)|stripshortcodes }}

1
  • thanks @McKean, that worked great. Thought I had searched everywhere in the docs - obviously not. – ShayH Jul 3 '17 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.