views:

110

answers:

3

I have my Wordpress blog on blog.mysite.com, and a totally different site (built in my framework) at www.mysite.com.

I know if the blog and another site are on the same server, and have correct permissions, I can use the following to "syndicate" my blogs to the non-blog site with:

define('WP_USE_THEMES', false);
require('/var/www/vhosts/mysite/subdomains/blog/httpdocs/wp-config.php');
query_posts('showposts=5');

...and then run a loop on the page.

The problem is that since my non-blog site is a framework, everything except for my front controller lives in a function - and this is creating the following error for me:

Fatal error: Call to undefined method stdClass::set_prefix()

(btw, I'm fairly certain the fact that this code is called within a function that is causing the error...when I put the code on the front controller (not in function), the error disappears)

I would REALLY like to have recent blog listings on my non-blog site to spruce it up. Any ideas on how to do this?

+1  A: 

Well I guess you forgot to write

global $wpdb

inside the function

atif089
A: 

The error line is not inside a function.

Andy
what does this mean?
johnnietheblack
That error is always at the same location in the Wordpress source. Take a look at that area. It's not inside a function.
Andy
A: 

John can you write the function code too?

Mamaduka