Javascript 直接将脚本排队,而不是先注册
注册样式表然后将其排队与直接将其排队有何不同 我在这里注册,然后排队Javascript 直接将脚本排队,而不是先注册,javascript,php,css,Javascript,Php,Css,注册样式表然后将其排队与直接将其排队有何不同 我在这里注册,然后排队 function calling_script(){ wp_register_style('bootstrap', get_template_uri(). `enter code here`'/css/bootstrap.min.css',array(),'1.0.0', 'all'); wp_enqueue_style('bootstrap'); wp_register_style('styl
function calling_script(){
wp_register_style('bootstrap', get_template_uri(). `enter code here`'/css/bootstrap.min.css',array(),'1.0.0', 'all');
wp_enqueue_style('bootstrap');
wp_register_style('style', get_template_uri(). '/css/style.css',array(),'1.0.0', 'all');
wp_enqueue_style('style');
}
add_action('wp_enqueue_style','calling_script');
在这里,我直接排队:
function calling_resources(){
//Calling Styles
wp_enqueue_style('style',get_stylesheet_uri(),'','1.0.0');
wp_enqueue_style('comment_style',get_template_directory_uri().'/css/comments.css','','1.0.0');
wp_enqueue_style('404 style',get_template_directory_uri().'/css/style-404.css','','1.0.0');
}
add_action('wp_enqueue_scripts','calling_resources');
两者工作原理相同。但我看到许多专家以这两种不同的方式进行研究 wp\U寄存器\U样式:-
这意味着,如果您想注册脚本,但不想直接将其加载到页面中,您可以注册一次文件,然后在需要时加载它们
wp_enque_风格:-
它可以帮助您加载脚本wp\u register\u样式:-
这意味着,如果您想注册脚本,但不想直接将其加载到页面中,您可以注册一次文件,然后在需要时加载它们
wp_enque_风格:-
它可以帮助您加载脚本您可以添加实际代码而不是图像吗?这将帮助更多与你有类似问题的人。你能添加实际代码而不是图片吗?这将帮助更多有类似问题的人。所以,我应该排队。好的,伙计,我应该排队。好的,伙计