Answer the question
In order to leave comments, you need to log in
How to make a different style for different categories and pages in Wordpress?
There are two css files, one should load on certain pages and categories, the other on all others.
The title snippet is:
<?php if( is_category(array( 16, 7, 5, 11, 12,6,8,22)) || in_category(16) || is_page( array(30, 28, 22, 34, 547, 553, 311, 529, 36, 40, 42, 38, 307)) && !is_home() && !is_category(4)) { ?>
<link rel="stylesheet" id="style-css" href="1.css" type="text/css" media="all" />
<?php }
else { ?>
<link rel="stylesheet" id="style-css" href="2.css" type="text/css" media="all" />
<?php } ?>
Answer the question
In order to leave comments, you need to log in
As far as I understand from the description of the functions is_category and in_category , these are several different functions - the first one relates to category templates (category.php), the second to posts (post.php).
And @avalak 's advice is good too
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question