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??
- The topic ‘Blog ID always returns 1’ is closed to new replies.