I have my wordpress theme setting for different stylesheet selection which is set using if else statement at front end.
my wordpress setting may have one value from following pool of values
red ,green, blue, yellow, white, pink, black, grey ,silver or purple
My template :
<link href="<?php bloginfo("template_url"); ?>/style.css" rel="stylesheet" media="all" />
<?php if (get_option('my_style') == "red" : ?>
<link href="<?php bloginfo("template_url"); ?>/css/red.css" rel="stylesheet" media="all" />
<?php endif; ?>
<?php if (get_option('my_style') == "green" : ?>
<link href="<?php bloginfo("template_url"); ?>/css/green.css" rel="stylesheet" media="all" />
<?php endif; ?>
<?php if (get_option('my_style') == "blue" : ?>
<link href="<?php bloginfo("template_url"); ?>/css/blue.css" rel="stylesheet" media="all" />
<?php endif; ?>
<?php if (get_option('my_style') == "yellow" : ?>
<link href="<?php bloginfo("template_url"); ?>/css/yellow.css" rel="stylesheet" media="all" />
<?php endif; ?>
.
.
.
.
.
<?php if (get_option('my_style') == "purple" : ?>
<link href="<?php bloginfo("template_url"); ?>/css/purple.css" rel="stylesheet" media="all" />
<?php endif; ?>
In this way I can get particular stylesheet as per need. But this php code become lengthy if there are more value in the option pool. So is there any way to shorten this using an array?