WordPress.org

Ready to get started?Download WordPress

Forums

Including WordPress Core into another script (1 post)

  1. whatshakin
    Member
    Posted 3 years ago #

    I am trying to include wordpress-ms core into another script using this:

    require_once( BX_DIRECTORY_PATH_ROOT . 'wordpress/wp-config.php');
    $wp->init();
    $wp->parse_request();
    $wp->query_posts();
    $wp->register_globals();
    $wp->send_headers();

    This worked perfect when WordPress was installed on the same database. But now I'm trying to separate them and when I try visit the site, it immediately ends the script an "Error establishing database connection" without loading anything.

    I print_r() the $GLOBALS for the scripts and it seems like they both share the same $GLOBALS['db'] array. I'm not sure if anyone has come across this situation before or has any ideas on how to get the wordpress core inside another script like this.

    Any suggestions would be greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic