【问题标题】:Wordpress shortcode not working in twig page templateWordpress 短代码在树枝页面模板中不起作用
【发布时间】:2016-04-06 07:36:56
【问题描述】:

我正在使用 Gantry5 框架(带有 g5_hydrogen 主题)并且我创建了一个可以正常工作的树枝页面模板,除了 Contact Form 7 插件的简码显然什么都不做 - 表单不会显示在页面上,并且当我检查浏览器中的元素,我只看到 div 标签之间有一些空格。我当前的标记是这样的:

{% block content %}
  <content>
    <div class="dbc-contact-form">
      {{ wp.do_shortcode('[contact-form-7 id="1234" title="Contact"]') }}  
    </div>
  </content>
{% endblock %}

之前有人发布过类似的问题,但不幸的是,该解决方案对我的情况没有帮助 - Wordpress twig template shortcode not displayed

感谢您对此的帮助。

【问题讨论】:

    标签: wordpress twig wordpress-theming shortcode


    【解决方案1】:

    试试这个 - {{ post.post_content|shortcodes }}

    【讨论】:

    • 您能否将其放在问题的上下文中,例如修改他们的代码以显示您的示例?
    猜你喜欢
    • 1970-01-01
    • 2014-06-04
    • 1970-01-01
    • 1970-01-01
    • 2015-05-10
    • 2014-05-25
    • 1970-01-01
    • 2013-08-07
    相关资源
    最近更新 更多