WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Comment Form Quicktags] Loading of js and css in head

[Plugin: Comment Form Quicktags] Loading of js and css in head

  • Regen,
    to avoid the loading of js and css in pages that don’t need them, I suggest to change these lines:

    function add_head() {
    
    	echo '<script src="' . $this->plugin_url . '/quicktags.php?ver=' . date('Ymd', $this->options['modified']) . '" type="text/javascript"></script>';
    
    	echo '<link rel="stylesheet" href="' . $this->plugin_url . '/style.css" type="text/css" media="screen" />';
    
    }

    into these:

    function add_head() {
    
    	if (is_singular()) {
    
    		echo '<script src="' . $this->plugin_url . '/quicktags.php?ver=' . date('Ymd', $this->options['modified']) . '" type="text/javascript"></script>';
    
    		echo '<link rel="stylesheet" href="' . $this->plugin_url . '/style.css" type="text/css" media="screen" />';
    
    	}
    
    }

    They are in comment-form-quicktags.php.

    What do you think?

    http://wordpress.org/extend/plugins/comment-form-quicktags/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Comment Form Quicktags] Loading of js and css in head’ is closed to new replies.
Skip to toolbar