php - Importing the style and scripts in the plugin doesn't work as well as in the theme

I import the same styles and scripts in the plugin and they don't work fully.The same styles and scripts if I impo

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' );
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745189173a4615780.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信