Loading stylesheets in parent & child themes

function theme_styles()  
{ 
  // Register the style like this for a theme:  
  // (First the unique name for the style (custom-style) then the src, 
  // then dependencies and ver no. and media type)
  wp_register_style( 'custom-style', // name the css include
    get_template_directory_uri() . '/css/custom-style.css', // css file
    array(), 
    '20120208', // version number
    'all' ); // applicable media

  // enqueing:
  wp_enqueue_style( 'custom-style' );
}
add_action('wp_print_styles', 'theme_styles');

Revisions

Tags: ,

No comments yet.

Leave a Reply