I guess you're trying to say that you want to show a different css file for every category you have in your website.
If that is the case, you will simply hook to wp_enqueue_scripts
and check if this is a category template using is_category()
and which category is this using get_the_category()
, and load the corresponding stylesheet.
Let's assume you have the files named with the same slug of the categories (i.e. photoshop -> photoshop.css, etc.):
function wpse220214_enqueue_category_style() {
if(is_category()) {
$slug = get_the_category(get_query_var( 'cat' ));
$url = get_stylesheet_directory_uri()."/css/categories/$slug.css";
if(file_exists($url)) { //So you don't get errors if the file is missing
wp_enqueue_style( "$slug-style", $url, array(), '1.0');
}
}
}
add_action('wp_enqueue_scripts', 'wpse220214_enqueue_category_style');
Edit: You mentioned that you are using a custom taxonomy, 'download_category' as I see in your comments. In this case we will use is_tax()
and get_queried_object()
instead:
function wpse220214_enqueue_download_category_style() {
if(is_tax('download_category')) {
$slug = get_queried_object()->slug;
$url = get_stylesheet_directory_uri()."/css/categories/$slug.css";
if(file_exists($url)) { //So you don't get errors if the file is missing
wp_enqueue_style( "$slug-style", $url, array(), '1.0');
}
}
}
add_action('wp_enqueue_scripts', 'wpse220214_enqueue_download_category_style');
Credit to this answer for using get_queried_object()
and this for get_query_var('cat')
.