Support » Themes and Templates » Versioning TwentyTwelve's CSS

  • Resolved coopersita



    I’m making a child theme for TwentyTwelve, but my host is caching my files, so I’m not seeing the changes I do to my style.css file.

    Is there a way to version the stylesheet for my child theme?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Ok, so what I did to fix it, is add a functions.php to my child-theme, and added the following:

    function my_theme_styles() {
        wp_enqueue_style('my-theme-style', get_bloginfo('template_directory') . '/style.css', false, date('h:i:s'));
    add_action('wp_head', 'my_theme_styles');

    So it loads the stylesheet twice, which is not ideal, but while the site is being developed, it helps keep the stylesheet fresh.

    Actually, this code will work. I had the wrong path to the theme’s folder:

    function my_theme_styles() {
        wp_enqueue_style('my-theme-style', get_stylesheet_directory_uri(). '/style.css', false, date('h:i:s'));
    add_action('wp_print_styles', 'my_theme_styles');
    Moderator Andrew Nevins


    Forum moderator

    Thanks for sharing 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Versioning TwentyTwelve's CSS’ is closed to new replies.