Skip to content

Instantly share code, notes, and snippets.

@keithort
Created November 25, 2016 21:03
Show Gist options
  • Save keithort/2b2be10589c613d222b8b64cd75f603e to your computer and use it in GitHub Desktop.
Save keithort/2b2be10589c613d222b8b64cd75f603e to your computer and use it in GitHub Desktop.
<?php
/**
* Enqueue scripts and styles.
*/
function site_scripts() {
// Include Google fonts
$query_args = array(
'family' => 'Open+Sans|Lato|Montserrat',
'subset' => 'latin,latin-ext', );
wp_enqueue_style( 'google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
wp_enqueue_style( 'styles', get_stylesheet_directory_uri() . '/dist/site.min.css' );
wp_enqueue_script( 'site-js', get_stylesheet_directory_uri() . '/dist/site.min.js', array( 'jquery' ), '', TRUE);
}
add_action( 'wp_enqueue_scripts', 'site_scripts', 11 );
/**
* Remove unnecessary WP items from head on sites without a blog
*/
function head_cleanup() {
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_shortlink_wp_head');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);
add_filter('the_generator', '__return_false');
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
}
add_action('after_setup_theme', 'head_cleanup');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment