mimi mimi - 2 months ago 6
CSS Question

Adding multiple css to Wordpress header.php

I have a few css files that need to be linked to the main PHP file for the slider, owl carousel plugin, etc.

After searcing, I found out how to add multiple css to my theme:

1) using



I can't figure out the different between them. I also want to know how to use them.

this is my style links before I convert my HTML theme to Wordpress:

<link rel="stylesheet" type="text/css"
<link rel="stylesheet" type="text/css" href="stylecss/bootstrap-3.2.rtl.css">
<link rel="stylesheet" href="fa/css/font-awesome.min.css">
<link rel="stylesheet" href="owl-carousel/owl.carousel.css">
<link rel="stylesheet" href="owl-carousel/owl.theme.css">
<link rel="stylesheet" type="text/css" href="stylecss/style.css">
<link rel="stylesheet" type="text/css" href="font/stylesheet.css">

This is the way I try to link my css file:

<!-- adding bootstrap style sheet -->

<?php wp_register_style('bootstrap-style1',get_template_directory_uri() . '/stylecss/bootstrap.min.rtl.css.css',array(),'null', 'all', );?>

<?php wp_register_style('bootstrap-style2',get_template_directory_uri() . '/stylecss/bootstrap-3.2.rtl.css',array(),'null', 'all', );

<!-- End of bootstrap style links -->
<!-- adding fonts style sheet -->

<?php wp_register_style('font-awesome',get_template_directory_uri() . 'fa/css/font-awesome.min.css',array(),'null', 'all', );
<?php wp_register_style('fonts',get_template_directory_uri() . 'font/stylesheet.css',array(),'null', 'all', );

<!-- End of fonts style links -->

What's the difference between adding this code to function.php and header.php? I read here that we can add both in header.php and function.php.


here is one of standard form to including css file in wordpress.

I put theme in function.php although I can't find what is the different between adding theme to function.php or header.php, not much different, just when you add theme in header.php is 't more flexible and you can cache more speed.

I use both of way one and two

wp_register_style('bootstrap-style1',get_template_directory_uri() . '/stylecss/bootstrap.min.rtl.css.css',array(),'null', 'all' );


and if you want to know more about differences between this two way as I asked you can use this link as Raunak Gupta told on his answer.