我使用codeigniter,並需要顯示最後3個職位從博客作爲blabla.com/blog位於。從wordpress獲取帖子到codeigniter視圖中的WP外
當我創建一個test.php文件如下。它工作得很好,
test.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>
但是當我複製相同的代碼來footer_view.php笨的結構法,它不工作,並給予如下錯誤:
codeigniter footer_view上的錯誤:
Fatal error: Call to undefined method stdClass::set_prefix() in /blabla/blog/wp-settings.php on line 268
任何想法可能是什麼問題? :/欣賞幫助!
我一直在谷歌研究,因爲我看到你的建議,但我找不到任何東西:/你知道有關於此? – 2009-11-07 08:56:16
這裏是一個很好的例子,如何解析與codeigniter RSS提要http://www.nextbigleap.com/index.php/blog/post/simplepie-rss-class-and-codeigniter – JoshHighland 2009-11-09 17:41:25