Display posts from one network site on another

You are looping through the posts queried before your switch_to_blog() statement. Your code appears to be from a page template which is executed AFTER the main query has run. To be clear, the main query is run before the template code is executed. Switching to another site after that does not update the query, therefore … Read more

Bug using wp_insert_term with switch_to_blog

Hook into ‘pre_insert_term’, $term, $taxonomy and dump the global $blog_id; to see if you’re on the right place: function wpse_inspect_blog_id( $term, $taxonomy ) { global $blog_id; var_dump( $blog_id ); exit; } function wpse_hook_inspector_blog_id() { add_filter( ‘pre_insert_term’, ‘wpse_inspect_blog_id’ ); } add_action( ‘init’, ‘wpse_hook_inspector_blog_id’ );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)