【发布时间】:2019-04-15 04:27:36
【问题描述】:
我正在尝试创办一家公司并正在为该公司创建网站。当我实时查看网站时,它全是 html,没有 css,但我在 ehder 和 index.php 的 rel 样式表中链接了它,但仍然没有 css!所以我在网上做了一些研究并创建了一个functions.php文件,认为这是问题所在。现在我收到此错误
警告:add_action() 缺少参数 2,调用 /home2/elishaday/public_html/wp-content/themes/smmwca/css/functions.php 在第 7 行并在 /home2/elishaday/public_html/wp-includes/plugin.php 在第 405 行
致命错误:调用未定义的函数 get_template_uri() /home2/elishaday/public_html/wp-content/themes/smmwca/functions.php 第 5 行
这是我的functions.php文件!
请帮忙
<?php
add_theme_support( 'post-thumbnails' );
function enqueue2_my_custom_styles(){
wp_enqueue_style('animate css', get_template_uri() . '/css/styles.css', array(), '1.0.0', 'all');
}
add_action( 'wp_enqueue_scripts', 'enqueue2_my_custom_styles' );
【问题讨论】: