__( 'Primary Menu', 'syntax' ),
'secondary' => __( 'Footer Menu', 'syntax' ),
) );
$args = array(
'default-color' => 'ffffff',
'default-image' => '',
);
$args = apply_filters( 'syntax_custom_background_args', $args );
add_theme_support( 'custom-background', $args );
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery' ) );
}
endif; // syntax_setup
add_action( 'after_setup_theme', 'syntax_setup' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function syntax_widgets_init() {
register_sidebar( array(
'name' => __( 'Footer Sidebar 1', 'syntax' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer Sidebar 2', 'syntax' ),
'id' => 'sidebar-2',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Sidebar 3', 'syntax' ),
'id' => 'sidebar-3',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'syntax_widgets_init' );
/**
* Enqueue scripts and styles
*/
function syntax_scripts() {
wp_enqueue_style( 'syntax-style', get_stylesheet_uri() );
wp_enqueue_style( 'syntax-merriweather' );
wp_enqueue_script( 'syntax-siteheader', get_template_directory_uri() . '/js/siteheader.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'syntax-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'syntax-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
}
}
add_action( 'wp_enqueue_scripts', 'syntax_scripts' );
/**
* Register Google Fonts
*/
function syntax_google_fonts() {
/* translators: If there are characters in your language that are not supported
by Merriweather, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'syntax' ) ) {
wp_register_style( 'syntax-merriweather', "https://fonts.googleapis.com/css?family=Merriweather:400,300italic,300,400italic,700,700italic&subset=latin,latin-ext" );
}
}
add_action( 'init', 'syntax_google_fonts' );
/**
* Enqueue Google Fonts for custom headers
*/
function syntax_admin_scripts( $hook_suffix ) {
if ( 'appearance_page_custom-header' != $hook_suffix )
return;
wp_enqueue_style( 'syntax-merriweather' );
}
add_action( 'admin_enqueue_scripts', 'syntax_admin_scripts' );
/**
* Adds additional stylesheets to the TinyMCE editor if needed.
*
* @param string $mce_css CSS path to load in TinyMCE.
* @return string
*/
function syntax_mce_css( $mce_css ) {
$font = "https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic";
if ( empty( $font ) )
return $mce_css;
if ( ! empty( $mce_css ) )
$mce_css .= ',';
$font= esc_url_raw( str_replace( ',', '%2C', $font ) );
return $mce_css . $font;
}
add_filter( 'mce_css', 'syntax_mce_css' );
/**
* 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';