【问题标题】:Wordpress Easy Contact Forms integration via php通过 php 集成 Wordpress Easy Contact Forms
【发布时间】:2014-07-22 20:36:29
【问题描述】:

我正在尝试通过文本编辑器将 Wordpress Easy Contact Forms 插件添加到我的页面,方法是使用以下内容:[easy_contact_forms fid=1],然后使用 php 回显页面内容:

<?php 
$post51 = get_post( 51);
echo $post51->post_content; 
?> 

但是它只打印[easy_contact_forms fid=1] 而不是实际形式。

如何通过 php 获取表单而不是文本内容?

【问题讨论】:

    标签: php wordpress plugins contact-form


    【解决方案1】:

    这是因为 $post51->post_content 没有“执行”短代码。

    尝试:

    $post51 = get_post( 51 );
    echo do_shortcode($post51->post_content);
    

    http://codex.wordpress.org/Function_Reference/do_shortcode

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-03
      • 2018-07-05
      • 2015-04-25
      • 1970-01-01
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多