Add CSS File in function.php WordPress

wp_enqueue_style('style', get_template_directory_uri().'/style.css', array(), null, $theme_version, 'print');
wp_enqueue_style('bootstrap-min',get_template_directory_uri().'/assets/vendor/bootstrap/css/bootstrap.min.css',
array(), $theme_version, 'all');
wp_enqueue_style('bootstrap-icons', get_template_directory_uri().'/assets/vendor/bootstrap-icons/bootstrap-icons.css', array(), $theme_version, 'all');
wp_enqueue_style('swiper-bundle', get_template_directory_uri().'/assets/vendor/swiper/swiper-bundle.min.css', array(), $theme_version, 'all');
}
add_action('wp_enqueue_scripts', 'mytheme_register_styles');
?>

Syntax:


function function-name()
{
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_style('style', get_template_directory_uri().'path of style.css', array(), null, $theme_version, 'print');
}
add_action('wp_enqueue_scripts', 'function-name');
?>

Leave a Reply

Your email address will not be published. Required fields are marked *