WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Call style.css from functions.php (5 posts)

  1. WebmistressM
    Member
    Posted 3 years ago #

    So far, there is no documentation that speaks about how to call up any given theme's style.css. It seems to often be done in header.php.

    However, since Im using my theme's functions.php file to call scripts and styles, I would be curious how I could call style.css from functions.php instead. That way, all my stylesheets will be manageable in one location for that theme.

  2. ClaytonJames
    Member
    Posted 3 years ago #

    I think it's usually "bloginfo" with the correct parameters to point to a style sheet. Reference Material

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    That way, all my stylesheets will be manageable in one location for that theme.

    I believe that calls the style sheet from whatever theme directory is presently in use. I'm not sure if it could be placed in functions.php and still wind up between the "head" tags when loaded, though.

  3. WebmistressM
    Member
    Posted 3 years ago #

    So I could possibly do

    wp_enqueue_style('style', get_bloginfo('stylesheet_url'), false, '1.0', 'all');

    but not:

    wp_enqueue_style('style', get_bloginfo('stylesheet_url') . '/style.css', false, '1.0', 'all');

  4. ClaytonJames
    Member
    Posted 3 years ago #

    I guess your method (or perhaps simply the purpose) is beyond my grasp. I suppose if you were trying to call a style.php with dynamic properties rather than just a style.css, that might be an avenue of pursuit. Over my head I guess... sorry about that! :-)

  5. WebmistressM
    Member
    Posted 3 years ago #

    Okay, no problem. HOpefully someone has the answer. I just intend this theme to be one that people can use. so, that said, I am jsut trying to know how to call these other files in relation to that goal

Topic Closed

This topic has been closed to new replies.

About this Topic