• Hello, I have a folder called ‘css’ inside my custom theme folder. The normal way to link to a css file from the head tag in the header.php file doesn’t work. What is the syntax I am supposed to use?

    By normal way to link to the css file I mean:

    <link rel="stylesheet" type="text/css" href="css/global.css" />

    Also, does WP have a special way to get the first segment of the url and use it in a conditional?

    Example:
    <?php if(strcmp($url_segment_1, “about”) == 0) { ?>
    <link rel=”stylesheet” type=”text/css” href=”css/about.css” />
    <?php } elseif(…) { … ?>

Viewing 1 replies (of 1 total)
  • Thread Starter paul_fury

    (@paul_fury)

    ok, so i found how to get the links working properly, i have to do it this way:

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/global.css" />

    But I still would like to know if WP has a special way to get the url segments for use in conditionals.

Viewing 1 replies (of 1 total)

The topic ‘Theme css’ is closed to new replies.