Insert Wordpress shortcode into a file . Twig

Asked

Viewed 22 times

0

I’m updating a site that is using tend with Twig, I need to simply put a shortcode, but the solution I have is not working, could someone give me a light? the Twig code I tried was:

<div>{{post.custom_shortcode_field('[wdi_feed id="1"]')}}</div>

But the result is just an empty div...

1 answer

1


I found some things:

{% filter shortcodes %}
    [wdi_feed id="1"]
{% endfilter %}

or:

{{ function('do_shortcode', '[wdi_feed id="1"]') }}

or, if this shortcode is in a custom field, just add the pipe shortcodes:

{{ post.NOME_DO_FIELD | shortcodes }}
  • Perfect! Solved, Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.