Skip to content

Instantly share code, notes, and snippets.

@btribouillet
Created June 2, 2016 05:52
Show Gist options
  • Save btribouillet/a27bb37eb356a034c30bdeeebb79003b to your computer and use it in GitHub Desktop.
Save btribouillet/a27bb37eb356a034c30bdeeebb79003b to your computer and use it in GitHub Desktop.
<?php
/**
* goliath functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package goliath-skeleton-classic-menu
* @author Studio Goliath <hello@studio-goliath.com>
*/
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function sg_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
*/
load_theme_textdomain( 'sg', get_template_directory() . '/languages' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'sg' ),
) );
}
add_action( 'after_setup_theme', 'sg_setup' );
/**
* Enqueue scripts and styles.
*/
function sg_scripts() {
// Css
wp_enqueue_style( 'sg-style', get_template_directory_uri() . '/css/style.min.css', array(), '20160530' );
// Js
wp_enqueue_script( 'sg-scripts', get_template_directory_uri() . '/js/scripts.min.js', array('jquery'), '20160530', true );
}
add_action( 'wp_enqueue_scripts', 'sg_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment