php - <?php wp_head(); ?> 函数不包括 functions.php 中的函数

标签 php css wordpress wordpress-theming

我对 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/

相关文章:

php - isset 静态类属性

html - 过渡不适用于 Firefox

jquery - footable:removeClass 不适用于扩展行

php - 在 wordpress 中执行 sql 查询

php - 在浏览器中保存 css 文件以备将来使用

php - 从 $GET 将 ip 插入 mysql php

html - 没有表格对齐

html - 居中水平导航栏

javascript - 在 Node.js 中验证 WooCommerce REST API

php - 将搜索重定向到主页