'ffffff', 'default-image' => '', ) ) ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'radcliffe' ), ) ); // Enable support for Post Formats add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style( array( 'inc/editor-style.css', radcliffe_base_font_url(), radcliffe_accent_font_url() ) ); /* * 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' ) ); } endif; // radcliffe_setup add_action( 'after_setup_theme', 'radcliffe_setup' ); /** * Register a footer widget areas. */ function radcliffe_widget_areas_reg() { register_sidebar(array( 'name' => __( 'Sidebar 1', 'radcliffe' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets in this area will be shown in the left column in the footer.', 'radcliffe' ), 'before_title' => '

', 'after_title' => '

', 'before_widget' => '' )); register_sidebar(array( 'name' => __( 'Sidebar 2', 'radcliffe' ), 'id' => 'sidebar-2', 'description' => __( 'Widgets in this area will be shown in the middle column in the footer.', 'radcliffe' ), 'before_title' => '

', 'after_title' => '

', 'before_widget' => '' )); register_sidebar(array( 'name' => __( 'Sidebar 3', 'radcliffe' ), 'id' => 'sidebar-3', 'description' => __( 'Widgets in this area will be shown in the right column in the footer.', 'radcliffe' ), 'before_title' => '

', 'after_title' => '

', 'before_widget' => '' )); } add_action( 'widgets_init', 'radcliffe_widget_areas_reg' ); /** * Register Open Sans Google font for Radcliffe * * @return string */ function radcliffe_base_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', 'radcliffe' ) ) { $font_url = add_query_arg( 'family', str_replace( ',', '%2C', 'Open+Sans:400italic,700italic,400,300,600,700,800' ), "https://fonts.googleapis.com/css" ); } return $font_url; } /** * Register Crimson Text Google font for Radcliffe * * @return string */ function radcliffe_accent_font_url() { $font_url = ''; /* * Translators: If there are characters in your language * that are not supported by Crimson Text, translate this to * 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Crimson Text font: on or off', 'radcliffe' ) ) { $font_url = add_query_arg( 'family', str_replace( ',', '%2C', 'Crimson+Text:400,400italic,700,700italic' ), "https://fonts.googleapis.com/css" ); } return $font_url; } /** * Register Abril Fatface Google font for Radcliffe * * @return string */ function radcliffe_header_font_url() { $font_url = ''; /* * Translators: If there are characters in your language * that are not supported by Abril Fatface, translate this to * 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Abril Fatface font: on or off', 'radcliffe' ) ) { $font_url = add_query_arg( 'family', 'Abril+Fatface:400', "https://fonts.googleapis.com/css" ); } return $font_url; } /** * Enqueue scripts and styles. */ function radcliffe_scripts() { // Add Open Sand font, used in the main stylesheet. wp_enqueue_style( 'radcliffe-base', radcliffe_base_font_url(), array(), null ); // Add Crimson Text font, used in the main stylesheet. wp_enqueue_style( 'radcliffe-accent', radcliffe_accent_font_url(), array(), null ); // Add Abril Fatface font, used in the main stylesheet. wp_enqueue_style( 'radcliffe-header', radcliffe_header_font_url(), array(), null ); // Radcliffe main styles wp_enqueue_style( 'radcliffe-style', get_stylesheet_uri() ); // Add picturefill.js to pollyfill the element in unsupporting browsers wp_enqueue_script( 'radcliffe-picturefill', get_template_directory_uri() . '/js/picturefill.js', array( 'jquery' ), '', true ); // Add Backstretch.js for featured images wp_enqueue_script( 'radcliffe-backstretch', get_template_directory_uri() . '/js/jquery.backstretch.js', array( 'jquery' ), '', true ); // Radcliffe main scripts wp_enqueue_script( 'radcliffe-global', get_template_directory_uri() . '/js/global.js', array( 'jquery' ), '', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'radcliffe_scripts' ); /** * Count the number of footer sidebars to enable dynamic classes for the widget container. */ function radcliffe_footer_class() { $count = 0; if ( is_active_sidebar( 'sidebar-1' ) ) { $count++; } if ( is_active_sidebar( 'sidebar-2' ) ) { $count++; } if ( is_active_sidebar( 'sidebar-3' ) ) { $count++; } $class = ''; switch ( $count ) { case '1': $class = 'one-column'; break; case '2': $class = 'two-column'; break; case '3': $class = 'three-column'; break; } if ( $class ) { echo $class; } } /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php';