我对 wordpress 及其功能有疑问,我一直在尝试在 functions.php 中包含一个 css 文件,如下所示:
function alien_includer() {
wp_enqueue_style('customstyles', get_template_directory_uri() .
'/css/alien.css', array(), '1.0.0', 'all');
}
add_action('wp_enqueue_scripts', 'alien_includer');
?>
所以问题是我没有设法包含 css 表,即使我已经像这样编写了 header.php:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>The best Theme</title>
<!--php functions-->
<?php wp_head(); ?>
</head>
<body>
非常感谢您的帮助。是的,我环顾四周,类似的问题可能会被这个thread解决
但这对我没有帮助。
****编辑**** Am not alowed to add pictures just yet.
最佳答案
你需要点击这个链接
https://developer.wordpress.org/reference/functions/wp_enqueue_style/
如果您仍然需要帮助但问题没有得到解决,请将查询发送到我的邮箱 ashok[dot]amn [at] gmail
我会回复你,但不要忘记附上代码或具有访问权限的实时链接。
关于php - <?php wp_head(); ?> 函数不包括 functions.php 中的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46788475/