Skip to content

Instantly share code, notes, and snippets.

@dabrattoli
Created June 12, 2016 15:40
Show Gist options
  • Save dabrattoli/1d12123cd607277ee2393dded667e541 to your computer and use it in GitHub Desktop.
Save dabrattoli/1d12123cd607277ee2393dded667e541 to your computer and use it in GitHub Desktop.
WordCamp NEO 2016 Custom Responsive Theme Workshop Code Samples
/* The file in your theme directory will be titled Functions.php .*/
/* I named the file above so that you would understand what the file is and where it goes */
/* In this case you will be adding this code to Functions.php file in you child theme */
function child_wcneo_foundation_scripts() {
/* Add Parent Theme Styles */
wp_enqueue_style( 'demo-framework-style', get_template_directory_uri() .'/style.css' );
/* ----- Add Foundation Support From Parent Theme ----- */
/* Add Foundation CSS */
wp_enqueue_style( 'foundation-app', get_template_directory_uri() . '/foundation/css/app.css' );
wp_enqueue_style( 'foundation', get_template_directory_uri() . '/foundation/css/foundation.css' );
/* Add Foundation JS */
wp_enqueue_script( 'foundation-js', get_template_directory_uri() . '/foundation/js/foundation.min.js', array( 'jquery' ), '1', true );
wp_enqueue_script( 'foundation-modernizr-js', get_template_directory_uri() . '/foundation/js/vendor/modernizr.js', array( 'jquery' ), '1', true );
/* Foundation Init JS */
wp_enqueue_script( 'foundation-init-js', get_template_directory_uri() . '/foundation.js', array( 'jquery' ), '1', true );
}
add_action( 'wp_enqueue_scripts', 'child_wcneo_foundation_scripts' );
jQuery(document).ready(function($) {
$(document).foundation();
});
/* The file in your theme directory will be titled Functions.php .*/
/* I named the file above so that you would understand what the file is and where it goes */
/* In this case you will be adding this code to Functions.php file in your theme folder*/
function wcneo_foundation_scripts() {
wp_enqueue_style( 'foundation-app', get_stylesheet_directory_uri() . '/foundation/css/app.css' );
wp_enqueue_style( 'foundation', get_stylesheet_directory_uri() . '/foundation/css/foundation.css' );
wp_enqueue_style( 'demo-custom-style', get_stylesheet_directory_uri() . '/custom.css', array(), '1' );
wp_enqueue_script( 'foundation-js', get_template_directory_uri() . '/foundation/js/foundation.min.js', array( 'jquery' ), '1', true );
wp_enqueue_script( 'foundation-modernizr- js', get_template_directory_uri() . '/foundation/js/vendor/modernizr.js', array( 'jquery' ), '1', true );
wp_enqueue_script( 'foundation-init-js', get_template_directory_uri() . '/foundation-init.js', array( 'jquery' ), '1', true );
}
add_action( 'wp_enqueue_scripts', 'wcneo_foundation_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment