WordPress.org

Support

Support » Themes and Templates » [Resolved] Call style.css from functions.php

[Resolved] Call style.css from functions.php

  • 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    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');

    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! 🙂

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Call style.css from functions.php’ is closed to new replies.
Skip to toolbar