WordPress.org

Ready to get started?Download WordPress

Forums

Change get_bloginfo('stylesheet_directory') and stylesheet_url? (2 posts)

  1. heavym
    Member
    Posted 4 years ago #

    Good Morning!

    I am testing out a theme but I noticed all of the CSS files are in the main theme folder, rather than in a CSS folder inside the theme folder.

    I can easily move the CSS files into a CSS folder, and change the header.php reference to the CSS files, but throughout all of the files their are several references to: get_bloginfo('stylesheet_directory') and stylesheet_url.

    Where would I go to change the directory stored in those variables? In a file or in the database and if so where abouts? Thanks in advance!

    Cheers,
    Christopher Beckwith

  2. tankianann
    Member
    Posted 3 years ago #

    Each variable is assembled differently, best way is to just do a 'find' inside your wordpress code to see what filters are called, and then just addfilter.

    Try something like this in your functions.php, to change stylesheet_url

    add_filter("stylesheet_uri", "blogo_stylesheet_uri");

    /** This changes the stylesheet to style.php instead of style.css */
    function blogo_stylesheet_uri(){
    $stylesheet_dir_uri = get_stylesheet_directory_uri();
    $stylesheet_uri = $stylesheet_dir_uri . "/style.php";
    return $stylesheet_uri;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags