Hi this is what I did to solve it:
add_filter( 'script_loader_src', 'change_src' );
add_filter( 'style_loader_src', 'change_src' );
function change_src( $url )
{
if( is_admin() ) return $url; // Don't filter admin area
return str_replace( site_url(), 'www.mysite.com/mydefaultnetworksite', $url );
}
I’m using both those filters because I want it to apply to script and stylesheet urls. The function just looks for the site url, rips it out and replaces it with a hardcoded version of the url I want all the sites scripts / stylesheets to point to.
I opted for the first site in the multisite, but it could be any 🙂
Related Posts:
- Odd Script File Trying to be Loaded
- How do you load WordPress from an external script when using MultiSite? [duplicate]
- Least expensive way to get table prefix in multisite installation
- WordPress network vs Separate installs
- Trying to Decide Between Reverse-proxy and Multisite
- Delete all blogs on multisite
- Domain mapping breaks some plugin scripts and css
- Avoid landing page redirects issue in wordpress multisite
- restore_current_blog() vs switch_to_blog()
- How to get blog name, when using WordPress Multisite
- Which asset URLs are acceptable in a “vanilla” MU install?
- Using MAMP and Xip.io to view a WordPress Multisite on a local network
- REST API for Multisite
- How can I display all Multisite blogs where this user is administrator?
- Multisite: use media from one site vs. copying the same media to all language sites?
- Create unique robots.txt for every site on multisite-installation
- Nginx rules for subdomain multisite install (Bedrock)
- “Upgrade Network” error: stuck with SSL certificate verification
- when using add_user_to_blog getting error “Call to undefined function get_userdata”
- Restrict the user access in multi site for non-assigned blogs
- Getting an ERROR: Cookies are blocked error when logging in to a site on a different domain?
- display merged posts from multisite and sort by latest date
- WordPress 3.2(Multisite) – How to add custom user meta fields to signup form?
- Force Uploads Use Yearmonth to off (0) for all existing sites in Multisites
- WordPress Multisite – Multiple Subdirectories
- Images uploading to wrong directory after changing to multisite
- Why are images uploaded to main domain, when using multisite with different domains?
- Subdomain login problems
- Importing Multiple DB to one MU database
- How to Redirect login User with Mapped Domiain Primary blog Url to Original Sub-site Url
- Determining the compatibility of Settings API & Multisite
- Downgrading a WP3.3.1 Network Install
- WP Multisite – domain mapping to domain.com and separate site to domain.com/help
- Update User Role Across Network when Main Site User is Updated
- Shared User Tables on 2 WordPress Sites; “Main” Site and “Discuss” using P2?
- Get the User ID Who Owns a Given Blog ID in Multisite
- Create custom role, multisite, add users/sites?
- https redirect hell (adding www)
- How to disable W3 Total Cache “Performance” menu under multisite? [closed]
- Redirect subdomain in Multisite installation?
- Will revisions be retained when converting to a multi-site?
- How to create sub site in wordpress multisite programmatically?
- Multisite on localhost using xampp
- wp-config dynamic hostname in WP_HOME and WP_SITEURL
- Include only a domain path in multisite Network
- Jetpack API for WordPress Network
- WP doesn’t remove uploads from folder when removed from “Media Library”?
- How does WordPress determine which multisite the user is on from the URL?
- How can I use WP_Site_Query to find a blog by blog name?
- Limit entries number on network/sites.php
- Multi-language site on different domains
- How can I use separate domains for single pages?
- WordPress Multisite logout conflict
- SEO implications of assigning a new domain to a multisite subdomain [closed]
- How can I add custom meta on signup page and pass along to be used after blog activation?
- Conditional Image Sizes for Use via Theme Customizer Upload Only
- How to check main blog in a multisite using if statement?
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- Is there is a way to group a large number of WordPress Multisites For Easier Organisation?
- Multisite on single wordpress
- How can I map the primary domain for subsite as subdirectory for another domain?
- How to delete users from a WordPress MultiSite that stay in the DB?
- Update WP install to WP network & it broke the DB connection
- Installing other applications alongside WordPress multisite and configuring dns routing
- All Network sites display as main blog
- How can you customize on a multisite?
- Multi-site, different dashboard
- Two WordPress Installs — Failed page on One Defaults to the Other
- Function to check whether the user is at the top level of the network?
- How to check main site user level from subsite in a multisite network
- How to test custom links within a multisite while in development stage
- How to enable wp-admin and wp-login only over highport
- How to display custom logo on WordPress login page
- wp option get blogname –url=my-sub-site.com returning main site option
- Easily adding multiple existing users to a multisite site
- Display posts from one network site on another
- Using WordPress multisite for subsites only
- Multisite network on new domain
- Cannot enable WordPress Network – ‘MULTISITE’ already defined and false
- Multisite install on a sub-directory
- using htaccess to check for cookie on permalink then conditionall rewrite with query parameter
- How to change a logo on a wordpress site that is part of a 7 site multisite?
- Allow users on a multisite network to only have access to one subdomain
- Add external url to WooCommerce My Account navigation
- WordPress multisite: wp-admin 403 error
- How to have same admin login for more than one site?
- How to show another link post from another blog multisite? [closed]
- How to auto create site after user sign up on multisite(network)
- Authenticate WordPress Site through another WordPress installation?
- One login for 3 WordPress installations with combined user table doesn’t work
- Export to WXR for pages containing script and iframe tags
- WordPress MU users – how are they organized?
- Multisite installation without using domain root
- How does adding custom meta to signup form work?
- Can’t un-archive site after upgrading to WordPress 3.8
- How to handle responsive and non responsive websites in one WordPress Theme?
- Is it possible to put a site other than #1 as a Multisite top-level domain?
- Should I go for Multisite or separate WP Installation?
- Swap domains of two sites with each other in multisite
- Many big issues in the website, WP_Debug not showing