我使用 codeigniter,需要在位于 blabla.com/blog 的博客页脚处显示最后 3 篇文章。
当我创建如下 test.php 文件时。它运作良好,
测试.php
<?php
// Include Wordpress
define('WP_USE_THEMES', false);
require('./blog/wp-blog-header.php');
query_posts('showposts=3');
?>
<ul>
<?php while (have_posts()): the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
但是当我将相同的代码复制到 codeigniter structre 的 footer_view.php 时,它不起作用并给出如下错误:
codeigniter footer_view 处的错误:
致命错误:在第 268 行的 /blabla/blog/wp-settings.php 中调用未定义的方法 stdClass::set_prefix()
知道可能是什么问题吗?:/感谢帮助!