Instead of
<?php if(!is_home() || !is_front_page()) :?>
you could use
<?php else: ?>
This style will not affect the wp-admin part, only the front end of your web since this is used in header.php
.
A safe way is to use wp_register_style()
and wp_enqueue_style()
as described here in the Codex:
http://codex.wordpress.org/Function_Reference/wp_enqueue_style
http://codex.wordpress.org/Function_Reference/wp_register_style
In your case it could be:
function wpse85659_theme_styles()
{
// Register the styles
wp_register_style( 'global-style', get_template_directory_uri() . '/style.css', array(), '20130213', 'screen' );
wp_register_style( 'home-widget-style', get_template_directory_uri() . '/css/ot_nav_widget.css', array('global-style'), '20130213', 'screen' );
wp_register_style( 'home-birdcage-style', get_template_directory_uri() . '/css/birdcage.css', array('global-style','home-widget-style'), '20130213', 'screen');
wp_register_style( 'internal-widget-style', get_template_directory_uri() . '/css/ot_internal_nav_widget.css', array('global-style'), '20130213', 'screen' );
// Enqueing:
wp_enqueue_style( 'global-style' );
if(is_home() || is_front_page()) :
wp_enqueue_style( 'home-widget-style' );
wp_enqueue_style( 'home-birdcage-style' );
else:
wp_enqueue_style( 'internal-widget-style' );
endif;
}
add_action('wp_enqueue_scripts', 'wpse85659_theme_styles');
You can place this code example into your functions.php
file. Just remember to use the wp_head()
in your header.php
for this method.