Blog ID always returns 1
-
Hi
I have a multisite set up and have a function in my functions.php file. I am using the following code to try and get the current blog ID:
global $current_blog; switch_to_blog( $current_blog->blog_id; );
For some reason the blog ID is always returning 1. If I hard code in the ID as 2, everything works fine but I need this to work dynamically.
Does anyone have any suggestions??
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Blog ID always returns 1’ is closed to new replies.