-5
я пытаюсь добавить два файла JS на мой сайт тему:Как включить более одного JS в тему Wordpress?
- JS/jscripts.js
- JS/самозагрузки-парят-dropdown.js
код, который я использую :
function wptuts_scripts_with_jquery()
{
// Register the script like this for a plugin:
wp_register_script('custom-script', plugins_url('/js/custom-script.js', __FILE__), array('jquery'));
// or
// Register the script like this for a theme:
wp_register_script('custom-script', get_template_directory_uri() . '/js/custom-script.js', array('jquery'));
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script('custom-script');
}
add_action('wp_enqueue_scripts', 'wptuts_scripts_with_jquery');
от этой функции я могу добавить только один JS-файл, как добавить 2-й файл JS. Я новичок в Wordpress и PHP. Нужна помощь!! :)
Где у вас есть эти файлы js? В папке js темы? – devo
Действительно? Вы только что скопировали и ввели это непосредственно из [учебника] (http://code.tutsplus.com/articles/how-to-include-javascript-and-css-in-your-wordpress-themes-and-plugins --wp-24321), который точно объясняет, как делать то, что вы просите! – Joe