__( 'Primary Menu', 'museum' ), 'social' => __( 'Social Links', 'museum' ), ) ); // Enable support for Post Formats. add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'audio', 'quote', 'link' ) ); // Use HTML5 elements for these features add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); add_editor_style(); // Remove default gallery styles add_filter( 'use_default_gallery_style', '__return_false' ); } endif; // museum_setup add_action( 'after_setup_theme', 'museum_setup' ); /** * Register widgetized area and update sidebar with default widgets. */ function museum_widgets_init() { register_sidebar( array( 'name' => __( 'Left Footer Area', 'museum' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Right Footer Area', 'museum' ), 'id' => 'sidebar-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'museum_widgets_init' ); /** * Enqueue scripts and styles. */ function museum_scripts() { wp_enqueue_style( 'museum-style', get_stylesheet_uri() ); wp_enqueue_script( 'museum-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'museum-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '20130115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'museum_scripts' ); /** * Returns the Google font stylesheet URL, if available. * * The use of Quattrocento Sans and Playfair Display by default is * localized. For languages that use characters not supported by either * font, the font can be disabled. * * @since Museum 1.0 * * @return string Font stylesheet or empty string if disabled. */ function museum_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Quattrocento Sans, translate this to 'off'. Do not * translate into your own language. */ $quattrocento_sans = _x( 'on', 'Quattrocento Sans font: on or off', 'museum' ); /* Translators: If there are characters in your language that are not * supported by Playfair Display, translate this to 'off'. Do not * translate into your own language. */ $playfair_display = _x( 'on', 'Playfair Display font: on or off', 'museum' ); if ( 'off' !== $quattrocento_sans || 'off' !== $playfair_display ) { $font_families = array(); if ( 'off' !== $quattrocento_sans ) $font_families[] = 'Quattrocento+Sans:400,700'; if ( 'off' !== $playfair_display ) $font_families[] = 'Playfair+Display:400,400italic,700italic'; $protocol = is_ssl() ? 'https' : 'http'; $query_args = array( 'family' => implode( '|', $font_families ), 'subset' => 'latin,latin-ext', ); $fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ); } return $fonts_url; } /** * Loads our special font CSS file. * * To disable in a child theme, use wp_dequeue_style() * function mytheme_dequeue_fonts() { * wp_dequeue_style( 'museum-fonts' ); * } * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 ); * * @since Museum 1.0 * * @return void */ function museum_fonts() { $fonts_url = museum_fonts_url(); if ( ! empty( $fonts_url ) ) wp_enqueue_style( 'museum-fonts', esc_url_raw( $fonts_url ), array(), null ); } add_action( 'wp_enqueue_scripts', 'museum_fonts' ); /** * Adds additional stylesheets to the TinyMCE editor if needed. * * @uses museum_fonts_url() to get the Google Font stylesheet URL. * * @since Museum 1.0 * * @param string $mce_css CSS path to load in TinyMCE. * @return string */ function museum_mce_css( $mce_css ) { $fonts_url = museum_fonts_url(); if ( empty( $fonts_url ) ) return $mce_css; if ( ! empty( $mce_css ) ) $mce_css .= ','; $mce_css .= esc_url_raw( str_replace( ',', '%2C', $fonts_url ) ); return $mce_css; } add_filter( 'mce_css', 'museum_mce_css' ); /** * Count the number of footer sidebars to enable dynamic classes for the footer. * * @since Museum 1.0 */ function museum_footer_class() { $count = 0; if ( is_active_sidebar( 'sidebar-1' ) ) $count++; if ( is_active_sidebar( 'sidebar-2' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'one-column'; break; case '2': $class = 'two-column'; break; } if ( $class ) echo $class; } /** * 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. */ require get_template_directory() . '/inc/jetpack.php';