__( 'Primary Menu', 'eighties' ),
'social' => __( 'Social Menu', 'eighties' )
) );
// Enable support for Post Formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'link', 'quote', 'gallery', 'status', 'audio' ) );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'eighties_custom_background_args', array(
'default-color' => '2d2d2d',
'default-image' => '',
) ) );
// Enable support for HTML5 markup.
add_theme_support( 'html5', array(
'comment-list',
'search-form',
'comment-form',
'gallery',
) );
// Add Editor Style
add_editor_style( 'css/editor.css' );
}
endif; // eighties_setup
add_action( 'after_setup_theme', 'eighties_setup' );
/**
* Register a footer and interactive widget area.
*/
function eighties_widgets_init() {
/**
* Set up our interactive sidebar if a user decided
* to enable this sidebar via the Customizer.
*/
register_sidebar( array(
'name' => __( 'Sidebar', 'eighties' ),
'id' => 'sidebar-1',
'description' => __( 'This sidebar opens as a toggle on the right side of a users browser window. If empty, the sidebar with not display.', 'eighties' ),
'before_widget' => '',
'before_title' => '
',
) );
// Footer widget area one.
register_sidebar( array(
'name' => __( 'Footer One', 'eighties' ),
'id' => 'eighties-footer-one',
'description' => __( 'First widget area for the footer. If no widgets are provided, this footer section will not appear.', 'eighties' ),
'before_widget' => '',
'before_title' => '',
) );
// Footer widget area two.
register_sidebar( array(
'name' => __( 'Footer Two', 'eighties' ),
'id' => 'eighties-footer-two',
'description' => __( 'Second widget area for the footer. If no widgets are provided, this footer section will not appear.', 'eighties' ),
'before_widget' => '',
'before_title' => '',
) );
// Footer widget area three.
register_sidebar( array(
'name' => __( 'Footer Three', 'eighties' ),
'id' => 'eighties-footer-three',
'description' => __( 'Third widget area for the footer. If no widgets are provided, this footer section will not appear.', 'eighties' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'eighties_widgets_init' );
/**
* Register Righteous Google font for Eighties
*
* @return string
*/
function eighties_header_font_url() {
$font_url = '';
/*
* Translators: If there are characters in your language
* that are not supported by Righteous, translate this to
* 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Righteous font: on or off', 'eighties' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Righteous' ), "https://fonts.googleapis.com/css" );
}
return $font_url;
}
/**
* Register Varela Round Google font for Eighties
*
* @return string
*/
function eighties_headings_font_url() {
$font_url = '';
/*
* Translators: If there are characters in your language
* that are not supported by Varela Round, translate this to
* 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Varela Round font: on or off', 'eighties' ) ) {
$font_url = add_query_arg( 'family', 'Varela+Round', "https://fonts.googleapis.com/css" );
}
return $font_url;
}
/**
* Register Open Sans Google font for Eighties
*
* @return string
*/
function eighties_body_font_url() {
$font_url = '';
/*
* Translators: If there are characters in your language
* that are not supported by Open Sans, translate this to
* 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'eighties' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Open Sans:400italic,700italic,400,700' ), "https://fonts.googleapis.com/css" );
}
return $font_url;
}
/**
* Enqueue scripts and styles.
*/
function eighties_styles() {
// Add Righteous font, used in the main stylesheet.
wp_enqueue_style( 'eighties-header', eighties_header_font_url(), array(), null );
// Add Varela Round font, used in the main stylesheet.
wp_enqueue_style( 'eighties-headings', eighties_headings_font_url(), array(), null );
// Add Open Sans font, used in the main stylesheet.
wp_enqueue_style( 'eighties-body', eighties_body_font_url(), array(), null );
// Font Awesome Icons
wp_enqueue_style( 'eighties-font-awesome', get_template_directory_uri() . '/fonts/fa/font-awesome.css' );
// Eighties Styles
wp_enqueue_style( 'eighties', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'eighties_styles' );
/**
* JavaScript Detection.
*
* Adds a `js` class to the root `` element when JavaScript is detected.
*/
function eighties_javascript_detection() {
echo "\n";
}
add_action( 'wp_head', 'eighties_javascript_detection', 0 );
/**
* Enqueue scripts.
*/
function eighties_scripts() {
// Our scripts.
wp_enqueue_script( 'backstretch', get_template_directory_uri() . '/js/backstretch.js', array( 'jquery' ), '2.0.4', true );
wp_enqueue_script( 'eighties', get_template_directory_uri() . '/js/eighties.js', array( 'jquery' ), '20140711', true );
wp_enqueue_script( 'skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', false, '20140711', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_home() || is_archive() || is_search() ) {
wp_enqueue_script( 'eighties-blog', get_template_directory_uri() . '/js/eighties-blog.js', array( 'backstretch' ), '20140711', true );
}
if ( is_post_type_archive( 'jetpack-portfolio' ) ) {
wp_enqueue_script( 'eighties-portfolio', get_template_directory_uri() . '/js/eighties-portfolio.js', array( 'jquery' ), '20140711', true );
}
if ( eighties_header_image() ) {
wp_enqueue_script( 'eighties-header', get_template_directory_uri() . '/js/eighties-header.js', array( 'backstretch' ), '20140711', true );
}
}
add_action( 'wp_enqueue_scripts', 'eighties_scripts' );
/**
* Enqueue Header Google fonts style to admin
* screen for custom header display.
*/
function eighties_admin_fonts() {
wp_enqueue_style( 'eighties-header', eighties_header_font_url(), array(), null );
}
add_action( 'admin_print_scripts-appearance_page_custom-header', 'eighties_admin_fonts' );
/**
* 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 post format functionality.
*/
require get_template_directory() . '/inc/post-formats.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.
*/
require get_template_directory() . '/inc/jetpack.php';