Skip to content

Instantly share code, notes, and snippets.

@AdamSoucie
Created August 31, 2018 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamSoucie/c22b436712a74252b390f1ebb081997f to your computer and use it in GitHub Desktop.
Save AdamSoucie/c22b436712a74252b390f1ebb081997f to your computer and use it in GitHub Desktop.
Loads assets for the child theme
<?php
/**
* Load files in the /assets/ directory
*
* @since 1.0.0
*/
function seven_pines_load_assets()
{
// Load the main Genesis stylesheet first
if ( is_child_theme() )
{
wp_enqueue_style( 'parent-style', trailingslashit( get_template_directory_uri() ) . 'style.css' );
}
// Load the main CSS file
wp_enqueue_style( 'seven-pines-styles', get_stylesheet_directory_uri() . '/css/main.css' );
// Additional styles we'll need
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'google-fonts', 'https://fonts.googleapis.com/css?family=EB+Garamond:400,700' );
// Necessary scripts
wp_enqueue_script( 'font-awesome', get_stylesheet_directory_uri() . '/js/fontawesome.min.js', NULL, NULL, true );
wp_enqueue_script( 'font-awesome-all', get_stylesheet_directory_uri() . '/js/fontawesome-all.min.js', NULL, NULL, true );
wp_enqueue_script( 'seven-pines-scripts', get_stylesheet_directory_uri() . '/js/scripts.js', array( 'jquery' ), NULL, true );
}
add_action( 'wp_enqueue_scripts', 'seven_pines_load_assets', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment