You can use two inbuilt functions to do this.
You can use both in the following way to make a function out of it which would give you the url to the theme. Put the below in the functions.php
file
function wpse_get_theme_url( $blog_id = 1 ){
switch_to_blog( $blog_id );
$template_url = get_stylesheet_directory_uri();
restore_current_blog(); // Switch back to the original blog
return $template_url;
}
Now you can use the above function to fetch the url by using the function and passing the blog id/ sub site id.
$theme_url = wpse_get_theme_url( $blog_id );
// Replace the $blog_id with blog id of your sub sites.
Related Posts:
- remove_action on after_setup_theme not working from child theme
- How to load scripts/styles specific for a page
- Is there any global functions.php file which works for any theme?
- Child theme – Overriding ‘require_once’ in functions.php
- Prevent “main” WPMU site_url() being returned in functions
- Display random categories on the front page (Finding and Editing Theme Functions)
- Issue with get_theme_mod returning a blank value instead of the saved value
- Implementing DNS Prefetching with WordPress
- Hourly Routine Not Firing ( wp_schedule_event() )
- Copy and delete a directory with WordPress functions
- which is the function that removes accented vowels?
- Theme Demo in live Site
- Customising widget titles/headings in WP 5.8
- Child Theme Not Overriding Parent Theme
- Different functions file for each site in multisite installation?
- Subfolder multisite issue. Themes and plugin files 404
- Where does function_exists() look to decide whether a function exists? [closed]
- Theme-Config tab in admin Pannel?
- Delete pages and Create default pages for all new network sites
- Multisite, either change the name of sample-page or create new page
- Loop (iterate) through Multi-Site sub-sites (blogs)?
- Global functions on WPMU
- Is It wrong to use oop approach on functions.php?
- PHP files included in functions.php don’t seem to work
- restore_current_blog required after switch_to_blog, if I use that in a function?
- How to remove howdy dropdown menu content
- Hook specific functions if on a specific admin page
- How can I change the do_action function in footer (copyright area)
- functions.php mistakenly deleted
- Run function when WordPress new multisite is created or ACF field is updated
- Echo tags used to describe the theme
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- changing behaviour of get_search_form
- Child Theme files – what is needed?
- How to load jQuery in the footer – nothing works for me
- Translation of theme using child theme
- How to stop twenty fifteen theme from cropping featured images?
- Theme functions.php file auto delete everyday [closed]
- How to remove style attribute in WordPress RSS output?
- WordPress website Rs changed to currency symbol
- Is there an alternative to get_template_directory_uri()?
- create filter in functions.php
- Add Custom Background Properties to Customizer
- Functions in custom theme
- Parse error after modifying the template menu [closed]
- Conditional Gravity Forms filter in WordPress Multisite
- Multisite Ajax serialize return error [object Object]
- Creating new blog on multisite programatically without hacks?
- How to get correct URLs in network wide menu (Multisite)?
- Multisite 404 on pages – rewrite error breaks database
- Has is_archived() for sites in a multisite changed with WP 4.7?
- Not all CSS elements transferring via parent to child?
- unnecessary request call for js and css after calling wp_dequeue_script
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Turn get_posts as string into an array for use in theme admin options
- Filter nav menu items HTML tags and wrap inner text with span
- Can’t switch to a child theme using filters template, option_template and option_stylesheet
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- dynamic site link for future migration in echo do_shortcode()
- Getting the teaser text without overriding global variables
- Default Nav Highlight
- “options.php” not found
- How to override this theme function in child theme
- get_template_directory() – references parent theme directory
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- functions.php return custom text
- How do I preserve changes to a theme’s functions.php across updates?
- Filepath to Chosen for “Home Page” option – Which function?
- Dashboard blocker on network multisite for specific user roles
- What function actually renders the wp_admin_bar ? How can I call it?
- Astra theme – cannot set short product description under the product title (product name)
- Members only function, but allow account activation [solved]
- Header menu aligned right on all pages except for single-post page [closed]
- Class parameter in get_avatar args doesn’t get added to output
- CSS style and app.js not loading
- Competing Login Redirects – Need to be Combined?
- Setting Up Child Theme To Take Priority
- Shortcode Initialization in a Custom Theme
- Adding a class to the body of an inactive site using multisite
- How to Call Function From Separate WordPress Install on Same Server?
- Getting back a blank WordPress site following functions code edit
- us states dropdown function and echo in theme template files
- How to pass a variable from a template page to the child theme functions.php
- wp_upload_bits – define (sub)folder / (sub)directory before filename?
- Random text changing to weird icons in both admin & front end
- Register a widget area when a theme option has been saved?
- How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]
- Additional Sidebar
- Run function from parent on child site
- Additional folder where will Media Library look for files
- Add custom css to theme
- Which template file to edit to edit homepage in Mystile [closed]
- Adding function to function.php error 505 [closed]
- How to get postId from the argument $block when register_block_type()?
- Ads Only at one website inside multisite network – code error
- Different ads on every website on multisite environment
- My website is generating weired url parameters of paginated pages
- How to automatically load Google Fonts on pages only as they’re used?