Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to undefined method stdClass::set_prefix()
#1

[eluser]Miha Iancu[/eluser]
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:Confusedet_prefix() ...."

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

Thanks!
#2

[eluser]Unknown[/eluser]
Please try to include this in your index.php. It Works !!!
#3

[eluser]Miha Iancu[/eluser]
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..
#4

[eluser]mercy loving criminal[/eluser]
Did you get an answer to this one? Would be interested to know more. Can you use WP and CI side-by-side?




Theme © iAndrew 2016 - Forum software by © MyBB