Support » Networking WordPress » Query posts of multisite outside WP

  • Resolved bitxl


    So I’m using a multisite WordPress install, and trying to query posts outside of wordpress.
    I’m doing so by including:

    define('WP_USE_THEMES', false);

    After that, I change the global $wpdb variable site id, blog id and table prefix:

    $wpdb->blogid = $id;
    	$wpdb->siteid = $id;

    from there on I would like to use query_posts and looking at the query in $wp_query it has selected the correct tables for querying however even when I try is_category with a slug I know exists I get false.
    Are these functions, like is_category and query_posts using variables I haven’t changed yet in order to query a perticular site of my multisite install?

    query_posts does work when no arguments are given… but when I try to give it a category id it gives no posts, even though they should be there…

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query posts of multisite outside WP’ is closed to new replies.