Part of the EllisLab Network
   
 
Fatal error: Call to undefined method stdClass::set_prefix()
Posted: 09 November 2009 08:58 PM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  7
Joined  10-01-2008

I have a Codeigniter application and I am trying to import for the Home page of the website some posts from a Wordpress blog installed on the server as well. I’ve tried to do this directly in my view:

<?php
// Include Wordpress
define(‘WP_USE_THEMES’, false);
require($_SERVER[‘DOCUMENT_ROOT’].’/blog/wp-blog-header.php’);
query_posts(‘showposts=1&cat=3’);
?>
I tried this code outside the Codeigniter app and it works but for the app it outputs this:

“Fatal error: Call to undefined method stdClass::set_prefix() ....”

Can anybody help me, please? Any piece of advice will be very much appreciate.

Thanks!

Profile
 
 
Posted: 28 November 2009 01:30 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  1
Joined  11-28-2009

Please try to include this in your index.php. It Works !!!

Profile
 
 
Posted: 28 November 2009 02:00 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  7
Joined  10-01-2008

Yes, I know but including Wordpress in index.php will override functions from codeigniter like for example site_url() which I use very often….so I am hoping for a solution that doesn’t override codeigniter core functions..

Profile
 
 
Posted: 23 February 2010 01:55 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  10
Joined  09-11-2009

Did you get an answer to this one? Would be interested to know more. Can you use WP and CI side-by-side?

Profile