Im trying to add an extra CSS file to my wordpress theme and switch between them as i switch website languages.
I added this code to my header.php file
<?php if (ICL_LANGUAGE_CODE == "ar"): ?><link rel="stylesheet" href="myfile.css" type="text/css" media="screen" />
<?php endif; ?>
and it doesnt seem to work, do i need to add another piece of code in another file to work? Im using wpml plugin
You can do this easily in the functions.php file of your theme.
path_to_your_theme/functions.php :
This method is the right method to add some CSS files to your theme :
I use wp_enqueue_style(), it's a safe way to add/enqueue a CSS style file to the wordpress generated page.
Codex page : http://codex.wordpress.org/Function_Reference/wp_enqueue_style