/* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ /** * Visual functions and definitions * * @package Visual * @since Visual 0.1 */ /** * Set the content width based on the theme's design and stylesheet. * * @since Visual 0.1 */ if ( ! isset( $content_width ) ) $content_width = 670; /* pixels */ function visual_content_width() { global $content_width; if ( is_home() || is_search() || is_archive() ) $content_width = 326; if ( is_page_template( 'page-fullwidth.php' ) ) $content_width = 990; } add_action( 'template_redirect', 'visual_content_width' ); /* * Load Jetpack compatibility file. */ require( get_template_directory() . '/inc/jetpack.php' ); if ( ! function_exists( 'visual_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * @since Visual 0.1 */ function visual_setup() { /** * 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' ); /** * Functions to enable the options */ require( get_template_directory() . '/inc/options-functions.php' ); /** * Customizer additions */ require( get_template_directory() . '/inc/customizer.php' ); /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on Visual, use a find and replace * to change 'visual' to the name of your theme in all the template files */ load_theme_textdomain( 'visual', get_template_directory() . '/languages' ); /** * Add default posts and comments RSS feed links to head */ add_theme_support( 'automatic-feed-links' ); /** * Enable support for Post Thumbnails */ add_theme_support( 'post-thumbnails' ); add_image_size( 'visual-thumbnail', 326, 999 ); add_image_size( 'visual-post', 700, 9999 ); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'visual' ), ) ); /** * Enable support for Post Formats */ add_theme_support( 'post-formats', array( 'image', 'gallery' ) ); } endif; // visual_setup add_action( 'after_setup_theme', 'visual_setup' ); /** * Register widgetized area and update sidebar with default widgets * * @since Visual 0.1 */ function visual_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'visual' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '