Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link multiple CSS files with WordPress

I know that to link your WordPress main style.css file you use:

<link href="<?php bloginfo('stylesheet_url');?>"rel="stylesheet" type="text/css"/>

However I have quite a few CSS files that need to be linked to the main PHP file for things like sliders, picture boxes etc...

I'm not quite sure how I would do that because the <?php bloginfo('stylesheet_url');?> only works for the stylesheet that is named styles.css and my other stylesheets all have different names.

Does anyone know how I can ink them all in?

like image 651
Ryman Holmes Avatar asked Dec 02 '22 18:12

Ryman Holmes


1 Answers

Just put all of your stylesheets in a directory wp-content\themes\twentyeleven\css.Then you can link all these by simply put below code-

<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style1.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style2.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style3.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style4.css" />

enjoy coding.

like image 139
Jay Avatar answered Dec 10 '22 18:12

Jay