【发布时间】:2017-06-01 23:06:44
【问题描述】:
<?php
/*
* Plugin Name: Add Fontawesome Animation
* Plugin URI: ...
* Description: This plugin is used to animate Fontawesome icons
* Version: 1.0.0
* Author: ...
* Author URI: ...
* License: GPLv2
* * */
// Enqueue font-awesome-animation.css
add_action( 'wp_enqueue_style', 'add_fontawesome_animation' );
function add_fontawesome_animation() {
wp_enqueue_style('font_awesome_animation', get_stylesheet_directory_uri() . '/css/font-awesome-animation.css' );
}
目标:加载 font-awesome-animation.css 以便 FontAwesome 图标可以动画。
使用:PhpStorm 并且刚刚开始使用 Genesis。我正在使用 genesis-sample 子主题,并且在大多数情况下,发布帖子和学习使用代码修改模板都进展顺利。
当我将 @import url("css/font-awesome-animation.css") 导入 style.css 文件时,FontAwesome 图标将动画化,否则我无法将 font-awesome-animation.css 从函数中排入队列。 php 或如上图所示的插件。当 PHP 中出现错误时,我在编辑器或页面中没有发现任何可观察到的错误,也没有得到典型的全白页面。有些东西是 FUBAR,我还不知道如何在 WordPress 中进行这种类型的调试,所以我需要知道代码可能有什么问题以及如何调试这种类型的 SNAFU 的建议。是否有某种类型的 Response.Write 可以用来显示路径等?
【问题讨论】:
-
看起来您正在将
wp_enqueue_style调用添加到wp_enqueue_style调用中。