WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Comment Form Quicktags] Loading of js and css in head (2 posts)

  1. aldolat
    Member
    Posted 3 years ago #

    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/

  2. Regen
    Member
    Posted 3 years ago #

    Thanks for your idea!
    It was included in the version 1.2.3.

Topic Closed

This topic has been closed to new replies.

About this Topic