Skip to content

Instantly share code, notes, and snippets.

@mojowill
Created June 11, 2017 17:44
Show Gist options
  • Save mojowill/fcf45bb522113117b848039edf41da7a to your computer and use it in GitHub Desktop.
Save mojowill/fcf45bb522113117b848039edf41da7a to your computer and use it in GitHub Desktop.
WordPress CSS 1
<?php
function global_css() {
wp_register_style( 'parent_main', get_template_directory_uri() . '/css/main.css', false, null, 'screen' );
wp_register_style( 'child_main', get_stylesheet_directory_uri() . '/style.css', false, null, 'screen' );
if ( ! is_admin() ) :
wp_enqueue_style( 'parent_main' );
endif;
wp_enqueue_style( 'child_main' );
}
add_action( 'wp_print_styles', 'global_css' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment