PHP in wordpress theme

Discussion in 'PHP/MySql' started by amber.long, Dec 2, 2009.

Remove these ads by signing in
Remove these ads by signing in
Thread Status:
Not open for further replies.
  1. amber.long New Member

    Member Since:
    Jun 20, 2009
    Message Count:
    29
    Likes Received:
    1
    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?
  2. Adam H Administrator

    Member Since:
    Jan 7, 2008
    Message Count:
    2,807
    Likes Received:
    162
    Occupation:
    Web Developer
    Location:
    Norfolk Uk
  3. SeoKungFu Active Member

    Member Since:
    Jul 10, 2009
    Message Count:
    603
    Likes Received:
    77
    Occupation:
    SEO Ninja
    at a first glance all these apostrophes and inverted commas mess...
  4. amber.long New Member

    Member Since:
    Jun 20, 2009
    Message Count:
    29
    Likes Received:
    1
    thanks Riverwire i'll try for this plugins
Thread Status:
Not open for further replies.

Share This Page