WordPress.org

Ready to get started?Download WordPress

Forums

Very Basic CSS question (7 posts)

  1. walshbj
    Member
    Posted 7 years ago #

    I'm looking through all the files in my theme and don't see where they reference the style.css file. Is that name a default name that is checked automatically or something?
    Like in the sidebar file, I expect to see a reference to style.css - but I don't see it.

    Sorry, I looked in the help and all over, maybe I'm just tired.

  2. Chris_K
    Member
    Posted 7 years ago #

    Have a peek at your theme's header.php file. You should find something reasonably similar to this:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    WordPress assembles the theme files at run-time. This page may be helpful Theme_Development

  3. walshbj
    Member
    Posted 7 years ago #

    Thanks for the quick reply. I do see that in my header.php.
    But I expected to see some kind of relative reference to the file called style.css, which I thought was the only style sheet for the theme I'm using - just the WordPress default theme.
    Even in the html you sent I don't see what part of it references the actual stylesheet file.
    I actually expected EVERY file in the theme to to have a reference to style.css. Does this header file inform each of the other files about the location of style.css as The Loop runs or am I way off about everything??
    Thanks.

  4. Chris_K
    Member
    Posted 7 years ago #


    But I expected to see some kind of relative reference to the file called style.css, which I thought was the only style sheet for the theme I'm using - just the WordPress default theme.

    That would be this portion: bloginfo('stylesheet_url');
    (here's the documentation for bloginfo())

    When you "View Source" of the rendered page, you see what that becomes.

    Expecting every file in the theme to have it shows you haven't looked over my link in the earlier post ;-)

  5. walshbj
    Member
    Posted 7 years ago #

    OK, you got me. I'll look it over.
    Thanks for the info. I'll post back if I get it sussed or ask more questions if I don't.
    And thanks for not taking my head off!

    o

  6. Chris_K
    Member
    Posted 7 years ago #

    Say, I bet you may find this page really helpful. And it directly answers your question: http://www.transycan.net/abc/visual_anat.html

  7. walshbj
    Member
    Posted 7 years ago #

    That page IS really helpful - thanks.

    I'm still puzzled, I need to read those links a few more times. I did see this in one of the online docs:

    Viewing CSS

    To view your CSS, either know the actual address (or have it already on your hard drive), or scroll down through the HTML page to the following reference:

    <link rel="style sheet" type="text/css" href="wordpress/wp-content/themes/default/style.css">

    What they describe here is what I'm expecting to see in all my template files, a reference to style.css.
    Are bloginfo and stylesheet_url placeholders or what?

    I probably haven't explained my self clearly at all. But I'll keep reviewing these docs.
    Do you see WHY I'm confused??

    btw- I have figured out SOME of WordPress. I've added a permalink link to all my output pages and got my categories all organized and structured in the sidebar. But I'm so stuck on this one thing.

    UPDATE:
    Just found this, which answers my question. This is what I was missing after you told me about what's in the header file:

    'stylesheet_url' - URL for primary CSS file. Returns: http//example.com/wp-content/themes/ + your-active-theme-name(value from wp_options, "stylesheet" row) + "/style.css"(hardcoded in functions.php)

Topic Closed

This topic has been closed to new replies.

About this Topic