__( 'Primary Menu', 'envision' ), ) ); // Enable support for Post Formats. add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'envision_custom_background_args', array( 'default-color' => '5c6d7e', 'default-image' => '', ) ) ); } endif; // envision_setup add_action( 'after_setup_theme', 'envision_setup' ); /** * Register widgetized area and update sidebar with default widgets. */ function envision_widgets_init() { register_sidebar( array( 'name' => __( 'Primary Sidebar', 'envision' ), 'id' => 'sidebar-1', 'description' => __( 'Main sidebar that appears on the left.', 'envision' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Sidebar', 'envision' ), 'id' => 'footer', 'description' => __( 'Secondary widget area that appears in the footer.', 'envision' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'envision_widgets_init' ); /** * Register Open Sans Google Font for envision. */ function envision_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. */ $font_url = add_query_arg( 'family', urlencode( 'Open Sans:300italic,400italic,600italic,700italic,300,400,600,700' ), "//fonts.googleapis.com/css" ); return $font_url; } /** * Enqueue scripts and styles. */ function envision_scripts() { wp_enqueue_style( 'envision-style', get_stylesheet_uri() ); // Add Open Sans Google Font. wp_enqueue_style( 'envision-open-sans', envision_font_url(), array(), null ); // Add Genericons font. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.2' ); wp_enqueue_script( 'envision-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'envision-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' ); } } add_action( 'wp_enqueue_scripts', 'envision_scripts' ); /** * 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'; /** * Add has-post-thumbnail class to content. */ function envision_post_classes( $classes ) { if ( ! post_password_required() && has_post_thumbnail() ) { $classes[] = 'has-post-thumbnail'; } return $classes; } add_filter( 'post_class', 'envision_post_classes' ); /** * Custom excerpt length. */ function envision_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'envision_excerpt_length', 11 ); /** * Custom excerpt read more. */ function envision_excerpt_more( $more ) { return ' Read More →'; } add_filter( 'excerpt_more', 'envision_excerpt_more' ); /** * Add editor styles. */ function envision_add_editor_styles() { add_editor_style( 'editor-style.css' ); } add_action( 'init', 'envision_add_editor_styles' );