我正在尝试为我的孩子主题创建一个css文件functions.php
在一个带有句柄的特定插件css文件之后openpos.bill.bootstrap
. 不幸的是,当前代码没有加载任何内容。Any idea how to solve this problem?
插件使用以下代码块加载样式
public function initScripts(){
global $op_in_pos_screen;
global $op_in_bill_screen;
global $op_in_kitchen_screen;
if($op_in_pos_screen)
{
add_action( \'init\', array($this,\'registerScripts\') ,10 );
}
if($op_in_bill_screen)
{
add_action( \'init\', array($this,\'registerBillScripts\') ,10 );
}
if($op_in_kitchen_screen)
{
add_action( \'init\', array($this,\'registerKitchenScripts\') ,10 );
}
add_filter(\'script_loader_tag\', array($this,\'add_async_attribute\'), 10, 2);
}
public function registerBillScripts(){
$info = $this->_core->getPluginInfo();
wp_enqueue_style(\'openpos.bill.bootstrap\', OPENPOS_URL.\'/assets/css/bootstrap.css\') // load my custom css after this one
// ... and so on
}
加载自定义样式的代码。无法加载任何内容的css文件
function load_custom_css_to_style_billing_screen() {
wp_enqueue_style(\'bill-screen-style\', get_stylesheet_directory_uri() . \'/include-parts-from-functions-php-file/frontend-related/plugins/openpos-plugin/pos-app/css/bill-screen-style.css\',array(\'openpos.bill.bootstrap\'));
}
add_action( \'wp_enqueue_scripts\', \'load_custom_css_to_style_billing_screen\', 10 );