Blog_id issues on Multisite Network
-
I want to preface my question by saying the network is inherited from another dev, I did not set it up so it’s complicating the issue.
Problem:
Within the multisite we have a main domain along with five subdomains (let’s say mainsite.xyz, subsite1.xyz, subsite2.xyz etc.).
In the footer I need to show values from ACF options page, which differ for each subdomain (it’s text). The main domain has that field left out empty = nothing shows.However, when I access the subsite1.xyz homepage the value in the footer is empty. I researched further, and the subdomain hompages seem to share the same blog_id and site_id values as the main domain – I echo it out in the footer using this:
global $wpdb; $site_id = $wpdb->siteid; /* tried also get_current_blog_id() */ $blog_id = $wpdb->blogid;This is the result in dev tools when I am on the subsite1.xyz homepage.
<footer blog_id="1" site_id="1" id="">The blog_id should be”2″ instead.
This is where it’s interesting: This problem doesn’t persist when I navigate to other pages within the same subdomain (e.g., “/contact/”) — in those cases, the correct and distinct IDs are presented = the ACF field value is showing.
I checked in the wp_blogs table and can confirm that the IDs are correctly configured there.
I am a bit lost as to what further can be done about it, looking forward to hearing your ideas.
The topic ‘Blog_id issues on Multisite Network’ is closed to new replies.