tag in the document head, and expect WordPress to provide it for us.
**/
add_theme_support( 'title-tag' );
/**
POST THUMBNAIL SUPPORT
@link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
**/
add_theme_support( 'post-thumbnails' );
/**
REGISTER NAVIGATION MENUS
This theme uses wp_nav_menu() in two locations.
**/
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', '_swank' ),
'social' => esc_html__( 'Social Media Menu', '_swank' ),
) );
/**
HTML5 COMPONENTS SUPPORT
Switch default core markup for search form, comment form, and comments to output valid HTML5.
**/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
/**
POST FORMAT SUPPORT
Enable support for Post Formats.
@link https://developer.wordpress.org/themes/functionality/post-formats/
**/
add_theme_support( 'post-formats', array(
'aside',
'audio',
'gallery',
'image',
'link',
'video',
'quote',
) );
/**
CUSTOM BACKGROUND SUPPORT
Set up the WordPress core custom background feature.
**/
add_theme_support( 'custom-background', apply_filters( '_swank_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/**
TinyMCE Editor Style
**/
add_editor_style( array( 'css/editor-style.css', _swank_fonts_url() ) );
}
endif; // _swank_setup
add_action( 'after_setup_theme', '_swank_setup' );
/**
CONTENT WIDTH
Set the content width in pixels, based on the theme's design and stylesheet.
Priority 0 to make it available to lower priority callbacks.
@global int $content_width
**/
function _swank_content_width() {
$GLOBALS['content_width'] = apply_filters( '_swank_content_width', 1000 );
}
add_action( 'after_setup_theme', '_swank_content_width', 0 );
/**
REGISTER WIDGET AREAS
@link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
**/
function _swank_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar 1', '_swank' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Sidebar 2', '_swank' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Sidebar 3', '_swank' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Sidebar 4', '_swank' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', '_swank_widgets_init' );
/**
ENQUEUE WEBFONTS
Enqueue fonts from Google and Font Awesome
**/
if ( ! function_exists( '_swank_fonts_url' ) ) {
function _swank_fonts_url() {
$fonts_url = '';
/*
Translators: If there are characters in your language that are not supported by Josefin Sans, translate this to 'off'.
Do not translate into your own language.
*/
$josefin_sans = _x( 'off', 'Josefin Sans font: on or off', '_swank' );
/*
Translators: If there are characters in your language that are not supported by Lora, translate this to 'off'.
Do not translate into your own language.
*/
$lato = _x( 'on', 'Lato font: on or off', '_swank' );
/*
Translators: If there are characters in your language that are not supported by Lora, translate this to 'off'.
Do not translate into your own language.
*/
$montserrat = _x( 'on', 'Montserrat font: on or off', '_swank' );
if ( 'off' !== $josefin_sans || 'off' !== $lato ) {
$font_families = array();
if ( 'off' !== $josefin_sans ) {
$font_families[] = 'Josefin Sans:300,700';
}
if ( 'off' !== $lato ) {
$font_families[] = 'Lato:400,700,400italic,700italic';
}
if ( 'off' !== $montserrat ) {
$font_families[] = 'Montserrat:400,700,400italic,700italic';
}
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' );
}
return $fonts_url;
}
}
/**
ENQUEUE SCRIPTS AND STYLES
**/
if ( ! function_exists( '_swank_scripts' ) ) {
function _swank_scripts() {
wp_enqueue_style( '_swank-style', get_stylesheet_uri() );
wp_enqueue_style( '_swank-fonts', _swank_fonts_url(), array(), null );
wp_enqueue_style( '_swank-fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), null );
wp_enqueue_script( '_swank-scripts', get_template_directory_uri() . '/js/swank-scripts.js', array( 'jquery' ), '20151015', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', '_swank_scripts' );
}
/**
IMPLEMENT THE CUSTOM HEADER FEATURE
**/
require get_template_directory() . '/inc/custom-header.php';
/**
CUSTOM TEMPLATE TAGS
**/
require get_template_directory() . '/inc/template-tags.php';
/**
CUSTOM FUNCTIONS
Functions that act independently of the theme template.
**/
require get_template_directory() . '/inc/extras.php';
/**
CUSTOMIZER ADDITIONS
**/
require get_template_directory() . '/inc/customizer.php';
/**
JETPACK COMPATIBILITY FILE
**/
require get_template_directory() . '/inc/jetpack.php';