Calling 2 different stylesheets wordpress (some logic within)

Hi guys I have some logic here that does not seem to be working for me. Currently I am trying to use two different stylesheets in wordpress. Here is the logic:

        <?php 

$url = "$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if ($url=="theurl.com")
    {
        ?><link rel="stylesheet" type="text/css" href="stylesheetforthispage.css" /><?;
    }
    else
   {
        ?><link rel="stylesheet" type="text/css" href="stylesheetforotherpages.css" /><?;
    }

    ?>

My problem is that the URL that I am trying to use the other stylesheet for is the homepage, and everytime I try this logic is does not seem to work? All help would be appreciated, thanks in advance!

Related posts

Leave a Reply

1 comment

  1. <?php
        if ($_SERVER["REQUEST_URI"] == "/")
            echo '<link rel="stylesheet" href="/css/homepage.css" type="text/css"/>';
        else
            echo '<link rel="stylesheet" href="/css/other-pages.css" type="text/css"/>';
    ?>