WordPress子主题JavaScript文件未加载
WordPress Child Theme JavaScript File Not Loading
有些人可以检查以下代码并告诉我为什么自定义脚本.JS文件没有加载。自定义样式。CSS 正在加载,但脚本文件未加载。我所指的代码位于底部的函数 CUSTOM_STYLES(),但我认为上面的代码一定很重要。
<?php
function bean_feature_setup()
{
$args = array(
'primary' => array(
'adminstyles' => true,
'customizer' => true,
'meta' => true,
'seo' => true,
'widgets' => true,
'widgetareas' => true,
'whitelabel' => false,
'updates' => false,
),
'plugins' => array(
'notice' => true,
'portfolio' => true,
'shortcodes' => true,
'twitter' => true,
'instagram' => true,
'social' => true,
'pricingtables' => true,
),
'comments' => array(
'pages' => false,
'portfolio' => false,
'posts' => true,
),
'debug' => array(
'footer' => false,
'queries' => false,
),
);
return apply_filters( 'bean_theme_config_args', $args );
}
add_action('bean_init', 'bean_feature_setup');
?>
<?php
function custom_styles() {
wp_enqueue_style('custom_style', get_stylesheet_directory_uri().'/custom-styles.css', array(),'', false);
wp_enqueue_script('custom-script', get_stylesheet_directory_uri().'/custom-script.js', array('jQuery'),'', false);
}
add_action('wp_enqueue_scripts','custom_styles');
?>
将
jQuery
更改为jquery
wp_enqueue_script('custom-script', get_stylesheet_directory_uri().'/custom-script.js', array('jquery'),'', false);
相关文章:
- 有没有任何方法可以将控制器从文件加载到ui路由器$stateProvider中
- Ajax文件加载和<输入>文件加载
- 使用Bootstrap将JSON文件加载到表中
- 将组合JSON文件加载到谷歌地图
- 将文本文件加载到javascript中
- jQuery Mobile样式从另一个文件加载内容
- 使用JavaScript将压缩文本文件加载到字符串中
- 数组在手动写入时有效,但从文本文件加载时无效
- 如何在打印前等待javascript文件加载twitter,并在打印后关闭选项卡
- 从文本文件加载jsondata时出现空白页
- AngularJS:如何使用ng-include将javascript文件加载到部分中
- 使用jquery将html文件加载到html中,用于离线/本地项目
- 从另一个grunt文件加载grunt任务
- 将php文件加载到弹出窗口中,并将php变量发布到该弹出窗口中(使用onclick)
- 如何使用node.js将不同的json文件加载到不同的json对象中
- 将变量从服务器上的外部文件加载到 HTML 文档中
- 节点 - 将 JSON 文件加载到代码中
- 如何使用 JavaScript/jQuery 将 XML 文件加载到 JSP/HTML 页面
- NodeJS和ExpressJS-Javascript文件加载,但CSS文件不加载;t
- D3.js:通过Force Layout从JSON文件加载多个网络