You’d have to make you site categories slug match your theme categories folder names.
Here’s how to filter themes: Hide a theme on list of themes in wp-admin without editing core files
And then, supposing a site has the category a-p and the themes are stored in themes/a-p/, this will filter them out:
add_filter( 'all_themes', 'remove_themes_ms_wpse_117537' );
function remove_themes_ms_wpse_117537( $themes )
{
if( 'site-themes-network' != get_current_screen()->id )
return $themes;
$site_cat = get_blog_option( absint( $_GET['id'] ), 'site_category' );
if( $site_cat )
{
# Unset themes not in the folder /themes/$site_cat/
foreach( $themes as $key => $theme )
{
if( strpos( $key, "$site_cat/" ) === false )
unset($themes[$key]);
}
}
return $themes;
}
Related Posts:
- Allow user to select a theme to install when they signup
- Changing Multisite themes on mass
- Hide a theme on list of themes in wp-admin without editing core files
- Can I install a theme on only one site of a multi-site network install?
- Can’t find “Add New” button for themes in a multisite
- How to move theme directory but not plugins/uploads out of WordPress root directory?
- Manipulate list of themes in wp-admin
- Subfolder multisite issue. Themes and plugin files 404
- cant enable theme in multisite
- Bulk activate a theme on multisite
- Using Two Themes – One for Main Site, One for Ecommerce
- Multi-site get_bloginfo(‘stylesheet_directory’) referring to sub-folder
- Multisite theme control not working
- WordPress MultiSite Theme
- Update configured themes
- How to show different sub sites based on Member’s user name In word press?
- Does a single theme license work on multisite? [closed]
- Create a CSS file in plugin folder when theme is activated
- Is it necessary to network enable both the parent and child theme for multisite installations?
- Trying to change active theme on all sites in Multisite
- Multisite > Edit Site > Themes – what are these themes?
- WordPress multisite with same content
- How to automate setup of theme, pages, widgets, etc for a new site in multi-site?
- Why WordPress w/ Nginx Multisite Only Lets Admin Upload ZIP Plugins But Not Themes? [closed]
- May I do multiple micro-sites with different themes in a single wordpress without subdirectory nor subdomain separation?
- How can I have two or more WordPress Pro (paid) themes that form a single website?
- Create link preview for theme wordpress
- Themes are visible in Network, but invisible in sites
- WordPress theme to support single website but with 3 sections for 3 languages
- WordPress multisite condition for certain blog_id’s
- WordPress Multisite – Auto enable theme
- Whats the best Practice for using a different Theme for WebView Apps?
- Creating a stand-alone site from a WordPress sub site
- Updating themes customized by users
- How to handle responsive and non responsive websites in one WordPress Theme?
- In a MS install, can you allow different users to have their own themes?
- How to mass change theme for all Multisite network sites?
- Iterating over every multisite / theme and list the pages
- different image for mobile template block theme
- Export/Import Blog Post from and to sites with different themes?
- 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
- Generate a user list per site to communicate upgrade plans
- Get all terms inside a specific taxonomy in a multisite
- New Multisite Network: redirected you too many times
- Getting a blog language (site “lang_id” field vs the WPLANG setting)
- Protect Uploads in Multisite
- Subdomain multisite gives 404 on sub sites
- Global Parent theme for all sites
- WordPress Multisite – is it possible to put the main site in a subdirectory?
- the blog owner multisite
- Multisite without .htaccess
- Multisite installation on IIS gives 404 trying to access the admin dashboard
- Is Partial SSL Possible? ( multisite )
- In Multisite “Sites” list, what do “deactivate” and “archive” really do?
- How to properly force https and www on multisite with Apache HTAccess
- Why does the My Site dropdown show only a single domain?
- Performance on WPMS
- Display site administrator’s id by current blog id inside link
- SELinux security vs WordPress updates
- Installed domain-based Multisite but can’t access wp-admin (redirect loop)
- Switch MultiSite main site with another (multilingual sites) – with subfolder – no subdomain
- WordPress Multisite’s in subdirectory not redirecting to dashboard settings
- My Media Library is broken across all my subsites
- Updated to version 3.8 and Admin pages are very slow. How to diagnose problem? [closed]
- Multisite install on subdomain w/ subdomains change siteURL
- Make uploads live outside of the WP folder
- Multi-Site Subfolder User Permission Issue
- Programmatically Add Item to WP Multisite Menus
- why there is a large file named core in wpmu’s directory?
- WordPress multi-site, developing locally and syncing live changes
- wp_get_attachment_image_src on multisite
- Problem with parked domain for my mutisite
- WordPress multisite – What’s the ideal setup for development/staging/production environments?
- WordPress self hosted site asking to login again when used www
- Multisite – big hosting package or several hosting packages?
- WordPress network vs Separate installs
- 404 on page 2 multisite
- How can I append blog_id to … echo [functions-defined-constant]?
- Page Builders and WP Multisite
- WordPress Multisite Add User
- How to have multiple WordPress Menus
- WP MS: How to query over the network
- Is a multisite install what I need?
- Infamous admin login redirect
- Manually Moving Posts/Pages/Comments/Tags from WPMU to WP3.0
- Setup another new subdomain root on top of multisite configuration
- Language per user role, how can I achieve this?
- Internet explorer not finding right content from multisite
- Change WordPress multisite to sub-folder installation
- How to add a link of “one” website in posts of “second” website in multisite WordPress
- No debug log for WP multisite is created
- Multisite – each site with it’s own set of users
- Migrate site from WordPress multisite to another WordPress multisite
- Split a Multisite Into Single WordPress Websites
- 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?
- Multiple WordPress sites on one hosting [closed]