admin管理员组文章数量:1415476
I import the same styles and scripts in the plugin and they don't work fully. The same styles and scripts if I import in the template it works great.
this is the code to import
add_filter( 'template_include', 'if_is_simulator', 1000 );
function if_is_simulator( $template ){
if(is_page_template('tempalte-simulotors.php')){
add_action( 'wp_enqueue_scripts', 'simulator_incloud' );
}
return $template;
}
function simulator_incloud() {
wp_enqueue_style(
'bootstrap-css',
SIMULATOR_URI.'css/bootstrap/bootstrap-4.0.0.css',
array(),
'4.3.1',
'all');
wp_enqueue_style(
'bootstrap-css-rtl',
'.2.1/css/bootstrap.min.css',
array(),
'4.3.1',
'all');
wp_enqueue_script(
'bootstrap-js',
'.2.1/js/bootstrap.min.js',
array('jquery'),
'4.3.1',
true);
wp_enqueue_script(
'fontawesome-js',
'.js',
array(),
'4.3.1',
true);
wp_enqueue_script(
'popper-js',
'.js/1.14.7/umd/popper.min.js',
array('jquery'),
'4.3.1',
false);
wp_enqueue_script(
'my-js',
SIMULATOR_URI .'js/script.js',
array('jquery'),
'4.3.1',
true);
wp_enqueue_style(
'simulator-style',
SIMULATOR_URI . 'css/rtl.css',
[
'simulator'
],
'1.0.0'
);
wp_enqueue_script( 'ajax_import_rows' );
}
本文标签: phpImporting the style and scripts in the plugin doesn39t work as well as in the theme
版权声明:本文标题:php - Importing the style and scripts in the plugin doesn't work as well as in the theme 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745189172a2646827.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论