Skip to:
Content
Pages
Categories
Search
Top
Bottom

Getting the URI of the stylesheet directory?


  • TonyVitabile
    Member

    @tonyvitabile

    OK, I’m working on integrating my WordPress & bbPress themes. I’m doing the work in the bbPress theme files.

    What I did was I copied the style.css from my WordPress theme into the new bbPress theme directory. Now I’m working on the header.php file, figuring the best place to start would be at the top of every page.

    The navigation bar from my WordPress theme uses a javascript file which is included in the scripts/ folder under the directory where the theme lives.

    I’m calling bb_get_active_theme_directory() to get the directory name, but this is not returning anything. The Appearance page in the admin console for bbPress is using the theme I’m editing, and viewing the page source shows the wrong value for the script file name.

    A couple of lines earlier in the header.php file, it calls bb_stylesheet_uri() & that returns the full URI of the stylesheet. I want everything that’s in there minus the “style.css”. How do I get it?

    Tony

Viewing 2 replies - 1 through 2 (of 2 total)

  • Tom(dB)
    Participant

    @tomdebruin

    I’m using bb_get_active_theme_directory() to detect any changes to my stylesheet.

    <link rel="stylesheet" href="<?php bb_stylesheet_uri(); echo '?' . filemtime( bb_get_active_theme_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

    if I echo bb_get_active_theme_directory() on my page it does return the correct value. I’m using bbP 1.0.1.


    TonyVitabile
    Member

    @tonyvitabile

    Thanks. I was able to get it to work a couple of minutes ago. If you call bb_active_theme_uri(), it echos the URI of the theme folder. This is what I needed.

    For some reason, I was getting an error that the function with _directory() instead of _uri() at the end didn’t exist in my PHP error log. I’ve got something that works so I’m gonna stick to it.

    Tony

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.