我想要显示我正在使用的联系表单 但shorcode没有在前端显示表格 如何用.twig文件显示联系表格7?
<div class="our_form">
{{ wp.do_shortcode('[contact-form-7 id="766" title="Contact form 1"]') }}
</div>
<form action="{{ post.link }}" class="contact-form" method="post" {{ form_enctype(form) }}>
<div class="contact-form__row">
{% spaceless %}
{{ form_row(form.name, {}) }}
{{ form_row(form.email, {}) }}
{{ form_row(form.subject, {}) }}
{% endspaceless %}
</div>
{{ form_row(form.message, {}) }}
{{ form_widget(form) }}
<button class="btn btn--primary caps">Send</button>
</form>
答案 0 :(得分:0)
如何像这样运行:
{% filter shortcodes %}
[contact-form-7 id="766" title="Contact form 1"]
{% endfilter %}
参考:https://timber.github.io/docs/guides/wp-integration/#shortcodes