【发布时间】:2019-03-04 16:58:45
【问题描述】:
我在 wordpress 中包含带有 functions.php 的 css/js 文件时遇到问题,我不知道我在查看其他论坛帖子时做错了什么。
这是我的functions.php
<?php
function home_script_enqueue() {
//css
wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/home.css', array(), '1.0.0', 'all');
//js
wp_enqueue_script( 'customjs', get_template_directory_uri() . '/js/home.js', array(), '1.0.0', true);
}
add_action('wp_enqueue_scripts()', 'home_script_enqueue');
在我的页眉和页脚文件中,我有 wp_head();和 wp_footer(); php标签内的函数
当我查看我的 Wordpress 网站并检查代码时,不仅没有任何变化,而且根本没有读取文件,而且我没有收到任何错误。
【问题讨论】:
标签: javascript php css wordpress include