Forums

Theme css (2 posts)

  1. paul_fury
    Member
    Posted 2 years ago #

    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(...) { ... ?>

  2. paul_fury
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.