get_current_blog_id()
uses the global variable $blog_id
as noted at https://codex.wordpress.org/Function_Reference/get_current_blog_id. When I’ve seen this problem before it’s because I’m declaring $blog_id
in my PHP code which is overwriting the WordPress global variable that provides the ID of the subsite.
Change the variable name of $blog_id
and hopefully the function will start returning the correct site ID.
Related Posts:
- How to get current site id? (WPMU)
- Get Permalink of Network Blog Post
- Multisite: I have a gap in my blogs. How to add the missing one?
- Multisite Pull Recent Image Attachments from Blog ID
- Get the User ID Who Owns a Given Blog ID in Multisite
- Get current Blog ID in Tinymce Plugin Dialog Window in WPMU
- Simplest way to query with blog_id?
- How to get blog_id of an MU site when running a custom function on the parent site
- WP MS: How to query over the network
- WPMU function get_blog_details, last_updated/registered and formatting time and date string
- How to delete post revisions?
- Upload path/URL weirdness for the main blog of a multisite/network setup
- WP_Site_Query vs. WP_Network_Query in WordPress 4.6
- Multisite/network–automatic self-registration, blog setup
- COOKIE_DOMAIN setting confusion
- WordPress Multisite with NGINX, subfolders, and FROM a subfolder
- How to consolidate all sitemaps in a multisite network?
- How to modify author base slug with groups and slug to use nice_nickname?
- How to make a newly registered site on multisite network “live” only when the user is ready
- Multisite installation combining subdomains and subdirectories
- How to find site id for one site on a multisite
- 3.9 breaks multisite
- Add site options UI in Multisite Sites > Infos page
- Stop wordpress from sending out moderation emails
- BP Multi Network & Members Directory [closed]
- Need to manually regsiter user, send the password and retreive their user ID
- Deleting sites and users automatically in multisite
- Make default new sites https (multisite)
- How to move theme directory but not plugins/uploads out of WordPress root directory?
- How to get a user role of a specific blog in multisite?
- Logout issue with new Domain on WP Multisite
- Subdomain and subdirectories together in one installation
- WordPress Installation for multi-domains with nginx and php-fpm
- Max number of multisites
- Get users primary blog URL in MultiSite
- WordPress MU Domain Mapping Customizer Error
- Is it possible to setup multiple sites with a common pool of posts?
- Not able to access dashboard of subdomain
- How to stop unlink images when remove a site or user
- Multisite Redirect issue
- Multisites, upload issues, and iOS!
- How to allow WordPress users create sub-website or mini-website under my domain with any basic site builder?
- Multisite new sites not found(404), main site still works [closed]
- How to get option values set from all sites within a Multisite setup?
- Stop WordPress Entirely and Run My Own Code
- How to host blog on separate domain from main site
- What is meant by Multisite in WordPress?
- Allow Author on Site A capability to upload files on Site B in Multi Site
- Can you manage multiple domain names from a single WordPress multisite network?
- Migrating wordpress multisite and domain mapping plugin
- WordPress Multisite – Can 2 domains share a database of users?
- Can you create a local wordpress network / multisite install on a mac with subdomains?
- How to solve this issue
- What is the way to share data between sites in a multisite
- ERR_TOO_MANY_REDIRECTS when i config my subdomains
- Subsite access without being a member of the subsite in wp multisite network
- Redirect loop after activating wordpress multisite feature
- Development of new theme and rollout on multisite
- WordPress Network (multisite) — how to ensure each site has their own admin URL?
- WordPress multisite proper prefix attribution
- Is it possible for a child-site of a multisite to be a multisite itself?
- WordPress stuck in deleting user
- How to show only blog-domain instead of the whole permalink in the loop
- Multisite installation on an existing single installation
- Multisite Sub domains not working
- How Can I Change The Name Of My Subdomain in WordPress Multisite
- Display site description instead of site name
- Multiple subsites in a single wordpress installation
- How to sync roles across Multisite?
- WordPress multi-site: How do I create the home page, the root URL?
- WordPress Multisites or Multiple WP Single sites?
- Is it possible to query posts with tax queries after multisite switch_to_blog() function?
- In Multisite the users profile picture keeps disappearing for “the other site”
- $_SERVER[‘SERVER_NAME’] in WP_SITEURL
- Two installs conflicting – Pages redirecting
- Give users acces to admin a single post or set up WP network?
- WP-Cli Error When Mapping Multisite Subdomain
- WordPress Multisite for multi-language
- Can I use the main Multisite as a backend only?
- WP Multisite Sub-Domain Error
- Downloading customized theme from wordpress
- WordPress multisite condition for certain blog_id’s
- the menu of the network does not display my second website
- Multisite – site user limited only for this site
- Get variable from previous blog while using switch_to_blog
- Nginx rules for subdomain multisite install (Bedrock)
- WP Admin Panel for Multi-site install not loading JavaScript for one Subdomain
- WordPress multisite not working
- multisite detect subsite blog number
- New multisite redirects to main site
- How to disable style filtering in post?
- Is it possible to create a login for restricted visibility?
- Create a Network of Different websites with wordpress
- WP Multisite: Do a function after blog is activated
- multi-language multi-site with REST API
- How to make Multisite global login that redirects to correct subsite after login
- Advice on WP site structure using multisite
- How to login Separately in each blog?
- WPMU and Chrimes Family Link app
- WordPress MU: Cookie error when trying to login on network WP instance