>>> DO NOT EDIT THIS FILE <<<< * * Warning! DO NOT EDIT THIS FILE, or any other theme file! If you edit ANY theme * file, all your changes will be LOST when you update the theme to a newer version. * Instead, if you need to change theme functionality, CREATE A CHILD THEME! * * >>>> DO NOT EDIT THIS FILE <<<< * * Sets up the theme and provides some helper functions. Some helper functions * are used in the theme as custom template tags. Others are attached to action and * filter hooks in WordPress to change core functionality. * * The first function, weaverx_setup(), sets up the theme by registering support * for various features in WordPress, such as post thumbnails, navigation menus, and the like. * * This file formatted 4/8 on tabs * * >>>> DO NOT EDIT THIS FILE <<<< */ add_action( 'after_setup_theme', 'weaverx_setup' ); // run weaverx_setup() when the 'after_setup_theme' hook is run if ( ! function_exists( 'weaverx_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. * * To override weaverx_setup() in a child theme, add your own weaverx_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, and Post Formats. * @uses register_nav_menus() To add support for navigation menus. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size * @uses add_theme_support( 'custom-header', $weaverx_header ) for WP 3.4+ custom header * * */ function weaverx_setup() { if ( ! isset( $content_width ) ) $content_width = (int)(WEAVERX_THEME_WIDTH * .75); // 1100 * .75 - default for content with a sidebar /* Make Weaver Xtreme available for translation. * * We will first allow the possibility that the user has a private translation in * wp-content/languages/ (to avoid the update overwrite problem), then load the theme's files. */ load_theme_textdomain('weaver-xtreme' , get_template_directory() . '/languages' ); // now theme's translations as fallback add_editor_style(); // editor-style add_editor_style( WEAVERX_GOOGLE_FONTS_URL ); // from settings.php - in %7C format // ******** add theme support possibilities ******** add_theme_support( 'automatic-feed-links' ); // Add default posts and comments RSS feed links to
. add_theme_support( 'customize-selective-refresh-widgets' ); // Add theme support for selective refresh for widgets. add_theme_support( 'html5', array( 'search-form' ) ); // html5 for search add_theme_support( 'post-formats', array( 'aside', 'audio', 'gallery', 'image', 'link', 'quote', 'status','video') ); // Add support for a variety of post formats // not supported: chat add_theme_support( 'post-thumbnails' ); // Featured Images add_theme_support( 'title-tag' ); // // now, need Weaver Xtreme settings available for everything else weaverx_init_opts('functions'); $width = weaverx_getopt_default('theme_width_int',WEAVERX_THEME_WIDTH); $height = weaverx_getopt_default('header_image_height_int',188); // now that everything is responsive, we can just set this to an arbitrary height. // Enable support for custom logo. add_theme_support( 'custom-logo', array('height' => $height, 'width' => $width, 'flex-height' => true, ) ); add_theme_support( 'align-wide' ); // gutenberg wide $weaverx_header = array( 'default-image' => '%s/assets/images/headers/winter-fog.jpg', 'random-default' => true, 'width' => $width, 'height' => $height, 'flex-height' => true, 'flex-width' => true, 'default-text-color' => '', 'header-text' => false, 'uploads' => true, 'video' => true, 'wp-head-callback' => '', 'admin-head-callback' => 'weaverx_admin_header_style', 'admin-preview-callback' => '', ); global $content_width; $content_width = $width; // let the WP $content_width be the same as theme width, and let our responsive CSS make it work. if (function_exists('get_custom_header')) { add_theme_support( 'custom-header', $weaverx_header); add_theme_support( 'custom-background'); } // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be the size of the header image that we just defined // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. // CHANGE NOTE: This call was removed from Weaver Xtreme 1.1. The semantics of WP have changed // since this was first added and was causing the unnecessary auto-generation of a pretty large // file for each and every image added to the media library. // set_post_thumbnail_size( $weaverx_header['width'], $weaverx_header['height'], true ); // ... and thus ends the changeable header business. weaverx_register_header_images(); // Weaver Xtreme supports two main nav menus register_nav_menus( array( 'header-mini' => __('Header Mini Menu: if specified, adds horizontal mini-menu to header', 'weaver-xtreme' /*adm*/), 'secondary' => __('Secondary Navigation: if specified, adds 2nd menu bar', 'weaver-xtreme' /*adm*/), 'primary' => __('Primary Navigation: if specified, used instead of Default menu', 'weaver-xtreme' /*adm*/), ) ); } } // weaverx_setup //-- if ( ! function_exists('weaverx_init_opts')) { function weaverx_init_opts($who='') { // this sets either the current settings, or the default values. weaverx_clear_opt_cache('weaverx_init_opts'); // start with a clear cache $themename = weaverx_getopt('themename'); // load the theme from the db if there (weaverx_getopt loads the options if there) if ($themename === false) { require_once('includes/get-default-settings.php'); // load a set of defaults weaverx_get_default_settings(); } // Keep some info for max_input_vars detection. These have to be collected here because the // WP settings API clears $_POST after the after_setup_theme action $GLOBALS['WVRX_POSTS'] = count($_POST, COUNT_RECURSIVE); // count all elements $GLOBALS['WVRX_GETS'] = count($_GET, COUNT_RECURSIVE); $GLOBALS['WVRX_COOKIES'] = count($_COOKIE, COUNT_RECURSIVE); } } //-- /** */ if (! function_exists( 'weaverx_register_header_images')) { function weaverx_register_header_images() { // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'maroon-bells' => array( 'url' => '%s/assets/images/headers/maroon-bells.jpg', 'thumbnail_url' => '%s/assets/images/headers/maroon-bells-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Maroon Bells', 'weaver-xtreme' /*adm*/) ), 'beckwith-mtn' => array( 'url' => '%s/assets/images/headers/beckwith-mtn.jpg', 'thumbnail_url' => '%s/assets/images/headers/beckwith-mtn-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Colorado Autumn', 'weaver-xtreme' /*adm*/) ), 'winter-fog' => array( 'url' => '%s/assets/images/headers/winter-fog.jpg', 'thumbnail_url' => '%s/assets/images/headers/winter-fog-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Wintery Fog', 'weaver-xtreme' /*adm*/) ) ) ); } } //-- if ( ! function_exists( 'weaverx_admin_header_style' ) ) { /** * Styles the header image displayed on the Appearance > Header admin panel. */ function weaverx_admin_header_style() { ?> 0) { $extra_list = explode(',', $extra_areas); foreach ($extra_list as $area) { weaverx_register_sidebar( __('Per Page Area ', 'weaver-xtreme' /*adm*/) . $area, 'per-page-'.$area, __('This widget area can be added using "', 'weaver-xtreme' /*adm*/ ) . $area . __('" as the name for Per Page options or the Weaver Xtreme Plus [widget_area] shortcode. Style it using: ', 'weaver-xtreme' /*adm*/ ) . '".per-page-' . $area .'".' ); } } } if ( ! function_exists('weaverx_register_sidebar')) { /** * Register widgetized areas * * @since Weaver Xtreme 1.0 */ function weaverx_register_sidebar($name, $id, $desc, $altclass='') { if ($altclass != '') $altclass .= ' '; register_sidebar( array( 'name' => $name, 'id' => $id, 'description' => $desc, 'before_widget' => '', 'before_title' => '