WordPress.org

Ready to get started?Download WordPress

Forums

Add PHP stylesheet to enqueue_styles in functions.php file? (6 posts)

  1. sparklogix
    Member
    Posted 1 year ago #

    I have a theme with custom Theme Options that is called from the stylesheet.php. It is called in the header.php file using this line of code:

    <?php get_template_part('elements/stylesheet'); ?>

    The problem is that it is being called at the very bottom of the header and anything in the enqueue_styles in the functions.php file is being loaded before the stylesheet.php file. This is causing problems with the Theme Options selections not being displayed correctly (or at all) in IE8 and IE9.

    I have tried moving the get_template_part around in the header but when I do, it causes the same styling problems in FF and Chrome.

    How can I add that stylesheet.php in the enqueue_styles? I had a developer on this and he just up and disappeared and this is beyond my scope.

    Thanks for any help!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    What theme are you using? Where did you download it from?

  3. sparklogix
    Member
    Posted 1 year ago #

    It's one that we are building, with the help of the developer that took off.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    I'm not sure that <?php get_template_part('elements/stylesheet'); ?> is the best way to deal with custom CSS in a theme. Have a look at http://wordpress.org/extend/themes/suffusion Pretty sure that theme also implements a custom CSS option and it will be doing so correctly.

  5. sparklogix
    Member
    Posted 1 year ago #

    It looks completely different than our theme, and since I'm not the one that created it, I'm not sure how I would go about applying what they used in that theme to ours.

  6. sparklogix
    Member
    Posted 1 year ago #

    Maybe I'm going about this the wrong way. Maybe I need a different solution than what I originally thought?

    Using the Developer Tools on IE, I noticed that even though the default background color from the style.css file was crossed out (indicating it was not being used), and the correct/custom background color from the stylesheet.php file was not being crossed out (indicating it is being used), it still displays the default color.

    So I'm confused as to why it's happening. Is it that the load order is wrong? Or is it something else?

Topic Closed

This topic has been closed to new replies.

About this Topic