Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Content Management System (http://www.go4expert.com/forums/content-management-system/)
-   -   PHP in wordpress theme (http://www.go4expert.com/forums/php-wordpress-theme-t20260/)

amber.long83 2Dec2009 15:22

PHP in wordpress theme
 
Hello everyone

I have problem with following code which I am trying to use to display a chunk of text in the header of a wordpress theme.

Code:
function hellishsimplicity_head() {echo '
<link rel="stylesheet" type="text/css" href="' , bloginfo('template_directory') , '/style' , get_option('hellishsimplicity_colour') , '.css" />';
$hellishsimplicity_colour = get_option('hellishsimplicity_colour');
}

However I would prefer to have an IF statement to control the HTML output.

Code:
function hellishsimplicity_head() {
if ($hellishsimplicity_colour == "blue") {echo "<link rel="stylesheet" type="text/css" href="' , bloginfo('template_directory') , '/styleblue'.css" />";}
else {echo "<link rel="stylesheet" type="text/css" href="' , bloginfo('template_directory') , '/stylered'.css" />";}
$hellishsimplicity_colour = get_option('hellishsimplicity_colour');
}

But it's not working Does anyone know Where I am wrong?


All times are GMT +5.5. The time now is 07:52.