Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hmm – found a sort of fix for me (typical! ??

    I moved the include/require statement out of the function it was in (seemed to work ok with old WP – 2.1 i think) and into the global scope (like in index.php). This is because everything that’s declared in a file included inside a function is local to that function (i RTFM’d some more)

    Hope that’s a clue enough for others – now i must get on, that that’s just about wasted my day!

    jonny

    Hi all

    I’m now getting the same thing (WP 2.6.2)

    WP works fine when i go to it’s page (or admin etc), but this is being included in another PHP app (which i didn’t write) and it seems it looses the “global-ness” of $wpdb, hence it being a non-object (actually uninitialized).

    If i declare “global $wpdb” in the function that includes “wordpress/wp-blog-header.php” it gets past this problem but fails later on the $wp object, for the same reason (and the same hack doesn’t fix it)

    I think it’s something to do with the directory structure of the site – index.php includes “classes/class.php”, which includes “wordpress/etc” and when it then gets inside “wordpress/wp-includes” the scope of what’s global changes… and i’m stumped too (sorry).

    I’ll carry on kludging (going to play with includes/requires), but if anyone knows more… we’d all be ever so grateful!

    Yours, hoping…

    jonny B

Viewing 2 replies - 1 through 2 (of 2 total)