我只是想创建一个插件,将一些JS添加到标题和自定义CSs中。我有以下内容,但它添加了错误的css并显示为JS。这是我尝试的第一个插件。
<?php
/**
* Plugin Name: mmoore5553 Simple Range Slider
* Plugin URI: mailto:[email protected]
* Description: Simple Range Slider
* Version: 1.0
* Author: [email protected]
* Author URI:
* License:GPL2
*/
function SimpleRangeSlider() {
wp_register_script(\'SimpleRangeSlider\', plugins_url(\'/js/simple-slider.js\', __FILE__), array(\'jquery\'),\'1.1\', true);
wp_enqueue_script(\'SimpleRangeSlider\');
}
add_action( \'wp_enqueue_scripts\', \'SimpleRangeSlider\' );
function SimpleRangeSlider1() {
wp_register_script(\'stylesheet1\', plugins_url(\'/css/simple-slider.css\', __FILE__));
wp_enqueue_script(\'stylesheet1\');
}
add_action( \'wp_enqueue_scripts\', \'SimpleRangeSlider1\' );
function SimpleRangeSlider2() {
wp_register_script(\'stylesheet2\', plugins_url(\'/css/simple-slider-volume.css\', __FILE__));
wp_enqueue_script(\'stylesheet2\');
}
add_action( \'wp_enqueue_scripts\', \'SimpleRangeSlider2\' );
?>