ThemeShaper Forums » Thematic

[closed]

Thematic Speed problem

(5 posts)
  • Started 2 years ago by Raptor
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Raptor
    Member

    Hi,
    I am using the thematic theme and love it. But it is only getting 50/100 in Google Page Speed. The main reason for this is it need gzip compression, how would I go about implementing gzip compression without using a plugin?

    Posted 2 years ago #
  2. gzip compression has nothing to do w/ thematic. i think you can enable it in your htaccess? try googling "enable gzip compression". the plugin WP htaControl is also helpful for working on your htaccess from the dashboard and comes w/ some standard speed tweaks you can easily enable. be careful w/ htaccess... you can break everything! be sure you have ftp access to upload a blank/backup should the proverbial shit hit the fan.

    though some things you can do to improve thematic itself include bundling all the JS scripts together into one and copying all your stylesheets into one versus using @import.

    // Filter away the default scripts loaded with Thematic
    function childtheme_head_scripts() {
        // Abscence makes the heart grow fonder
    }
    add_filter('thematic_head_scripts','childtheme_head_scripts');
    
    //replace with proper enqueing
    function enqueue_thematic_dropdowns(){
    	if(!is_admin()){
    		wp_enqueue_script('jquery');
    		wp_enqueue_script('thematic-dropdowns',JS.'/thematic-combined.js',array('jquery'));
    	}
    }
    add_action('wp_enqueue_scripts','enqueue_thematic_dropdowns');

    the above won't work until you define the JS constant which i do at the beginning of everything theme.

    //define some constants
    define('CHILDTHEME', get_bloginfo('stylesheet_directory'));
    define('JS', CHILDTHEME . '/js');

    i define a bunch of other folders too.. but if you don't care too then you can just change to

    wp_enqueue_script('thematic-dropdowns',get_bloginfo('stylesheet_directory') '/js/thematic-combined.js',array('jquery'));

    and it will still work as long as thematic-combined is a script in your child theme's js folder.

    here's thematic-combined.js
    http://pastebin.com/LtUZCrZi

    nothing special... just the 4 scripts pasted into one.

    Posted 2 years ago #
  3. Raptor
    Member

    I would like to use thematic for a premium theme I am making but I need a way of getting it to load faster. Thanks for the code to combine the scripts.

    Posted 2 years ago #
  4. Raptor
    Member

    Why isn't this working:

    // define the JS and CHILDTHEME constants
    define('CHILDTHEME', get_bloginfo('stylesheet_directory'));
    define('THELIB', CHILDTHEME . '/extensions/');

    // Overide defaults
    // Filter away the default scripts loaded with Thematic
    function childtheme_head_scripts() {
    // Abscence makes the heart grow fonder
    }
    add_filter('thematic_head_scripts','childtheme_head_scripts');

    //replace with proper enqueing
    function enqueue_thematic_dropdowns(){
    if(!is_admin()){
    wp_enqueue_script('jquery');
    wp_enqueue_script('thematic-dropdowns', THELIB . 'js/combined.js', array('jquery'));
    }
    }
    add_action('wp_enqueue_scripts','enqueue_thematic_dropdowns');

    I have a folder inside extensions with a folder called js and in that a file named combined.js but when I view source and click on the file it doesn't load and my dropdown doesn't work either.

    Posted 2 years ago #
  5. don't know. works fine here. try clearing your cache.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.