Revision 187 is a pre-publication revision. (Viewing current revision instead.)

Loading stylesheets in parent & child themes

[php]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');[/php]

Revisions

  • May 4, 2012 @ 02:03:20 [Current Revision] by PeterLugg
  • May 4, 2012 @ 02:01:05 by PeterLugg

Revision Differences

May 4, 2012 @ 02:01:05Current Revision
Content
 Added: [php]function theme_styles()
 Added: {
 Added: // Register the style like this for a theme:
 Added: // (First the unique name for the style (custom-style) then the src,
 Added: // then dependencies and ver no. and media type)
 Added: wp_register_style( 'custom-style', // name the css include
 Added: get_template_ directory_uri() . '/css/custom-style.css', // css file
 Added: array(),
 Added: '20120208', // version number
 Added: 'all' ); // applicable media
 Added: // enqueing:
 Added: wp_enqueue_style( 'custom-style' );
Deleted: Added: }
 Added: add_action('wp_ print_styles', 'theme_styles');[/php]

Note: Spaces may be added to comparison text to allow better line wrapping.

Tags: ,

No comments yet.

Leave a Reply