__( 'Primary Menu', 'spirit' ),
) );
/**
* Add support for post formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'status' ) );
/**
* Add support for custom backgrounds
*/
add_theme_support( 'custom-background', apply_filters( 'spirit_custom_background_args', array(
'default-color' => 'caeaf0',
'default-image' => get_template_directory_uri() . '/images/texture-background-2x.png',
'default-attachment' => 'fixed',
'wp-head-callback' => 'spirit_custom_background_cb'
) ) );
}
endif; // spirit_setup
add_action( 'after_setup_theme', 'spirit_setup' );
/*
* Custom background callback to apply background color to .site-description
*/
function spirit_custom_background_cb() {
$current_background = get_background_image();
$background_support = get_theme_support( 'custom-background' );
$default_background = $background_support[0];
$default_background = $default_background['default-image'];
$color = get_background_color();
if ( ! $current_background && ! $color )
return;
?>
__( 'Sidebar', 'spirit' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'spirit_widgets_init' );
function spirit_fonts() {
/* translators: If there are characters in your language that are not supported
by Oleo Script Swash Caps, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Oleo Script Swash Caps font: on or off', 'spirit' ) ) {
wp_register_style( 'spirit-oleoscriptswashcaps', "https://fonts.googleapis.com/css?family=Oleo+Script+Swash+Caps&subset=latin" );
}
/* translators: If there are characters in your language that are not supported
by PT Sans, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'PT Sans font: on or off', 'spirit' ) ) {
wp_register_style( 'spirit-ptsans', "https://fonts.googleapis.com/css?family=PT+Sans:400,700&subset=latin,latin-ext" );
}
/* translators: If there are characters in your language that are not supported
by PT Serif, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'PT Serif font: on or off', 'spirit' ) ) {
wp_register_style( 'spirit-ptserif', "https://fonts.googleapis.com/css?family=PT+Serif:400,700&subset=latin,latin-ext" );
}
}
add_action( 'init', 'spirit_fonts' );
/**
* Enqueue scripts and styles in custom header admin
*/
function spirit_admin_scripts( $hook_suffix ) {
if ( 'appearance_page_custom-header' != $hook_suffix )
return;
wp_enqueue_style( 'spirit-ptsans' );
wp_enqueue_style( 'spirit-oleoscriptswashcaps' );
}
add_action( 'admin_enqueue_scripts', 'spirit_admin_scripts' );
/**
* Enqueue scripts and styles
*/
function spirit_scripts() {
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'parallax', get_template_directory_uri() . '/js/parallax.js', array( 'jquery' ), '20121213', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style( 'spirit-ptsans' );
wp_enqueue_style( 'spirit-ptserif' );
wp_enqueue_style( 'spirit-oleoscriptswashcaps' );
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
}
}
add_action( 'wp_enqueue_scripts', 'spirit_scripts' );
/**
* Implement the Custom Header feature
*/
require( get_template_directory() . '/inc/custom-header.php' );
/**
* Custom template tags for this theme.
*/
require( get_template_directory() . '/inc/template-tags.php' );
/**
* Custom functions that act independently of the theme templates
*/
require( get_template_directory() . '/inc/extras.php' );
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
if ( file_exists( get_template_directory() . '/inc/jetpack.php' ) )
require get_template_directory() . '/inc/jetpack.php';