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
- Multisite on Windows with wildcard subdomains
- multisite 404 error for subdirectory
- How to hide or remove unwanted widgets on Multisite installation?
- How to use alias domain for multisite installation?
- Multisite htaccess on localhost with WP as an SVN external?
- WordPress Multisite with multiple domains using Nginx
- How would I compare and remove hacks to core?
- Multisite – Retrieve the same theme option from all sites of the network
- At MultiSite Network Update “Can’t Resolve host”, override and continue updating
- Creating multiple blogs
- Multisite Login Issues
- Multisite Conditional (if blog_id?) in a page template?
- Creating a Dev box from an existing production machine?
- Can I run a second wordpress site as a subdomain without using multisite?
- Shared upload folder in wordpress multisite
- What are the differences in capabilities between the super-administrator and administrator?
- WordPress multisite with different domain
- Rewrite rules in multisite
- Delete options from all blogs on plugin uninstall from a network/multisite
- Clone a wordpress website with same functionality, but different content
- Stuck with WordPress Multisite Custom signup page without .htaccess modification
- wp-admin redirect loop with ssl
- wordpress multisite, https for whole site or just admin?
- Multisite network admin – URL / redirect error
- Removing “Sub-menus” from My Sites Drop-down in Admin Bar
- wp_signon( $creds, false ); not working
- MultiSite Move conjures duplicate URL
- How to query WP Multisite primary site link
- Create batch of sites WordPress MultiSite
- Call to undefined function wp_get_sites()
- Pushing stored procedure to a multisite database in WordPress
- In multisite environment which is the most Popular blog?
- Share reusable blocks between network sites
- WordPress rewrite multisite blog url
- How to transfer existing WordPress website to new multisite wordpress domain?
- Can Multisite run without domain name in WordPress?
- Copying media from multisite subsites to main website
- WordPress Multisite blogs not working after domain swap
- How to create multisite roles with predefined themes
- Simplest way to query with blog_id?
- WordPress Multisite – Load users using custom query
- Is it possible to load wp-content/uploads from another server?
- Domain Mapping subsites of an Add-on Mulsite Domain
- Multi-Site / Single Site Decisions
- Multi-site site nav, wpdb->prepare missing argument
- Publish all network posts to the primary site
- query multisite blog for post by tag
- WordPress Multisite on multiple sub-domains
- How to migrate post media from stand-alone to multisite build
- How to add WordPress site to multisite network when both are addon domains
- Get posts by user role in a Multisite
- WPLANG option not available in localhost
- How can I make my existing VIP theme to multisite
- how to make a cronjob run, when user needs to be logged in
- All Subsites of a WordPress Multisite install 302 redirects to the main site
- How to find the site ID on a single site and then add new post with “`multipart/form-data” enctype?
- WordPress Domain Mapping shows new domain in place but takes me to the sub domain
- Problem in viewing recent posts from network site to main site
- Send data using GET method not work correctly
- How to create Network of websites with separate database in WordPress
- WordPress multidomains and subfolders