Php Wordpress样式表不加载
我目前正在为Wordpress构建一个插件,但是我的样式和脚本没有加载到查看页面中 功能:Php Wordpress样式表不加载,php,wordpress,Php,Wordpress,我目前正在为Wordpress构建一个插件,但是我的样式和脚本没有加载到查看页面中 功能: function getFrontEnd() { // we always need jquery wp_enqueue_script('jquery'); // load the core plugin scripts/styles wp_enqueue_script('flex-script', __DIR__ . '/view/assets/js/wp-flex.js');
function getFrontEnd()
{
// we always need jquery
wp_enqueue_script('jquery');
// load the core plugin scripts/styles
wp_enqueue_script('flex-script', __DIR__ . '/view/assets/js/wp-flex.js');
wp_enqueue_style('flex-style', __DIR__ . '/view/assets/css/wp-flex.css');
}
视图:
在FlexImport类中,您将发现执行html的文件的包含
检查后,这两个样式文件都不在html文件中
非常感谢 首先检查文件路径。使用以下命令:
wp_enqueue_样式('flex-script',plugin_dir_url(文件)。'view/assets/js/wp flex.js') 有人可以帮我吗?路径是正确的,但孔样式没有加载到插件页面上,这就是问题所在。
function getFlexImportView()
{
$pluginIndex = new controllers\FlexImport;
echo $pluginIndex->getOverview();
}