【问题标题】:Fatal error: Cannot redeclare- (previously declared in wordpress plugin致命错误:无法重新声明-(之前在 wordpress 插件中声明
【发布时间】:2012-06-01 20:39:31
【问题描述】:

我是 php 菜鸟 尝试为 wordpress 使用一个名为特色项目滑块的插件

-当我使用 shortcode 将其放置到页面或发布它工作正常。 -问题是当我尝试通过 php include 将其放置到我的模板中时,我收到此错误

(致命错误:无法在 /home/infostar 中重新声明 features_options_page()(之前在 /home/infostar/public_html/wp-content/plugins/featured-item-slider/featured-item-slider.php:36 中声明) /public_html/wp-content/plugins/featured-item-slider/featured-item-slider.php(第 37 行)

到目前为止我已经尝试过了 include_once 当我使用它时,我没有收到任何错误但没有显示 require_once 再次没有错误,但我的插件没有显示 get_included_files 仍然没有错误,但没有显示

我认为可能不会多次包含文件functions.php,因为当我使用简码调用它时它工作正常

有专家可以帮我吗???

【问题讨论】:

    标签: php wordpress plugins fatal-error


    【解决方案1】:

    您如何在模板中发布短代码?

    这里是根据 wordpress 支持线程的正确格式。 http://wordpress.org/support/topic/short-code-outside-page-or-post

    <?php echo do_shortcode('[catlist id=1 numberposts=5)]'); ?>
    

    实际的短代码用方括号括起来。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-29
      • 2015-08-29
      • 2012-06-18
      相关资源
      最近更新 更多