Depends a bit on your theme, but generally speaking you need to alter its header.php file. It’s usually best to create a child theme to do this if at all possible.
It’s essential to use a child theme if you’re using either twentyten or twentyeleven as your theme.
Cheers
PAE
Yes I am using a child theme, but my question was can I link my stylesheet (style.css) using a standard html href as opposed to the wordpress template tag. The reason I need to do this is because of the third party js file I would like to use to give older versions of IE CSS3 support.
Thanks.
Same answer.
The style sheet is usually referenced something like this, in header.php:
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
If you just wanted to add a class, for instance, you’d copy your parent theme’s header.php file to your child theme. Then you’d change the code above to read something like:
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" class="cssfx" />
Or if you wanted an entirely different stylesheet you’d do something like:
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_directory' ); ?>/effects.css" class="cssfx" />
Note the change to the bloginfo() parameter.
HTH
PAE
Hmm, I don’t see that line of code in my header.php (I’m using basic2col as my parent theme)
This is what I see, I think it’s pretty safe to say this line of php is generating the html href
<?php basic2col_css() ?>
Do you think replacing this line with your code would do the trick?
Thanks for your help.
Probably. Hard to say without access to the code. But you can try it for nothing. If it doesn’t work, you can always put it back.
Another thing you might do is to look at the basic2col_css() function. I’d guess it’s in functions.php. If the theme has been well coded and it has the if ( ! function_exists() ) condition wrapped around it you will be able to override the function in your own theme’s functions.php file. Simply copy the existing function into your own functions.php and then modify it to suit.
HTH
PAE
Ahhh thank you sir! I was able to add the class to basic2col_css() through functions.php just as you said. Much appreciated.
The pleasure is all mine.
PAE