Skip to content

Instantly share code, notes, and snippets.

@dividezigns
Created May 27, 2018 04:04
Show Gist options
  • Save dividezigns/9192dccdc44e1210e7c1ac907d2db015 to your computer and use it in GitHub Desktop.
Save dividezigns/9192dccdc44e1210e7c1ac907d2db015 to your computer and use it in GitHub Desktop.
This code will load other style.css files and js scripts. Place this code in the functions.php file in your child theme directory.
<?php
add_action( 'wp_enqueue_scripts', 'my_assets' );
function my_assets() {
wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'fancy-box-css', get_stylesheet_directory_uri() . '/css/jquery.fancybox.css' );
wp_enqueue_script( 'fancy-box-script', get_stylesheet_directory_uri() . '/js/jquery.fancybox.js', array( 'jquery' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment