Insert Wordpress shortcode into a .twig file

0

I'm updating a site that is using twig, I need to simply put a shortcode, but the solution I have is not working, could anyone 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 ...

    
asked by anonymous 08.06.2018 / 23:46

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 }}
    
09.06.2018 / 03:04