css – How to add external Scripts and Style sheets

Question

I need to add external Scripts and Style sheets. I am trying like below. I placed below code in functions.php file.

function team_scripts()
{
    wp_enqueue_script('team_script', get_template_directory_uri(). '/assets/js/team_script.js', array('jquery'), '1.0.0', true);
    wp_enqueue_script('Select2', 'https: //cdn.jsdelivr.net/npm/select249 ideas.1.0-rc.0/dist/js/select2.min.js', null, null, true);
    wp_enqueue_style('Select2', 'https: //cdn.jsdelivr.net/npm/select249 ideas.1.0-rc.0/dist/css/select2.min.css');
}

add_action('wp_enqueue_scripts', 'team_scripts');

But it is not working.

0
abu abu 1 month 2021-12-18T22:36:41-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse