If Else stops working after 2-3 choices
-
Hi, I have this code below thats working til 2-3 choices, after that it wont work and skips trough to the last one..
How come? How do I make this work. I want to switch css on 7 category’s..
Thanx in advance!
<!-- CHANGE CSS ON CATEGORY --> <?php if( in_category( 5 ) ) //fitness { ?> <link rel="stylesheet" href="<?php bloginfo('template_url')?>/sportsbar-fitness.css" type="text/css" media="screen" /> <?php } elseif ( in_category (3) ) //voetbal { ?> <link rel="stylesheet" href="<?php bloginfo('template_url')?>/sportsbar-voetbal.css" type="text/css" media="screen" /> <?php } elseif ( in_category (65) ) // basketbal { ?> <link rel="stylesheet" href="<?php bloginfo('template_url')?>/sportsbar-basketbal.css" type="text/css" media="screen" /> <?php } elseif ( in_category (66) ) // golf { ?> <link rel="stylesheet" href="<?php bloginfo('template_url')?>/sportsbar-golf.css" type="text/css" media="screen" /> <?php } else { ?> <link rel="stylesheet" href="<?php bloginfo('template_url')?>/sportsbar.css" type="text/css" media="screen" /> <?php } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘If Else stops working after 2-3 choices’ is closed to new replies.