how can I load switch_to_blog() function outside wordpress? $blog_id = '7'; require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); switch_to_blog($blog_id); echo get_option('blogname'); restore_current_blog(); echo 'You switched back.'; I get error: Fatal error:...
  • May 19, 2022
  • 0 Comments
im sure i must be doing something wrong and would really appreciate a little help. I am trying to loop through all of my Sub Dir “Multisite” blogs using...
  • May 16, 2022
  • 0 Comments
I have the code below for a multisite install. It works fine, but I need to merge each WP_Query loop object from each multisite together for use in another...
  • May 9, 2022
  • 0 Comments
Everything in explanation is about CDTuts I’ve created a WordPress Network and I want is to get the recent posts from all of the selected subdomain blogs. I need...
  • May 4, 2022
  • 0 Comments
I am using the WordPress multisite feature with Multilingual Press Pro to create a multilingual site with linked posts. In a network activated plugin the custom post types are...
  • May 3, 2022
  • 0 Comments
IT Nursery
When I call switch_to_blog() with a blog id, I don’t know whether that blog actually exists. The function returns always TRUE. Test case: switch_to_blog( PHP_INT_MAX ); $post = get_post(...
  • April 10, 2022
  • 0 Comments