Conditional CSS Stylesheets
-
I am working on a way to give multiple categories a style sheet. I know there must be a better way… but I am not the best with php.
Here is the code I am working with:
I thought this might work but apparently id did not.
<?php if ( is_category ('1' ,'8' , '9' , '10' , '11' , '12' , '13' , '14')) { ?> <link rel="stylesheet" href="<?php bloginfo('url'); ?>/wp-content/themes/wrastle-10/threads.css" type="text/css" media="screen" /> <?php } ?>
So I have fallen back on the oh so un-elegant.
<?php if ( is_category ('1')) { ?> <link rel="stylesheet" href="<?php bloginfo('url'); ?>/wp-content/themes/wrastle-10/custom.css" type="text/css" media="screen" /> <?php } ?> <?php if ( is_category ('8')) { ?> <link rel="stylesheet" href="<?php bloginfo('url'); ?>/wp-content/themes/wrastle-10/custom.css" type="text/css" media="screen" /> <?php } ?>
etc. etc.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Conditional CSS Stylesheets’ is closed to new replies.