在我的 div 中添加简码

Add shortcode in my div

我想在我创建的 div 主题中添加简码

这是div:

    <?php if(!is_home()): ?>

          <div id="cristi"><?php echo get_the_content(1); ?></div> 

   <?php endif; ?>

这是简码:

[contact-form-7 id="54" title="Contact form 1"]

这是link:

http://avocat.dac-proiect.ro/wp/?page_id=19

看看这一刻...

这个短代码 运行 需要更改什么?

提前致谢!

可能更适合 StackExchange Wordpress:https://wordpress.stackexchange.com/

要回答问题,您可以使用do_shortcode:http://codex.wordpress.org/Function_Reference/do_shortcode

<?php if(!is_home()): ?>

  <div id="cristi"><?php echo do_shortcode( '[contact-form-7 id="54" title="Contact form 1"]' ) ?></div> 

<?php endif; ?>