'ffffff' ) ) ); // Set up the WordPress core custom logo feature add_theme_support( 'custom-logo', apply_filters( 'gridbox_custom_logo_args', array( 'height' => 40, 'width' => 200, 'flex-height' => true, 'flex-width' => true, ) ) ); // Set up the WordPress core custom header feature. add_theme_support('custom-header', apply_filters( 'gridbox_custom_header_args', array( 'header-text' => false, 'width' => 1920, 'height' => 480, 'flex-height' => true ) ) ); // Add Theme Support for wooCommerce add_theme_support( 'woocommerce' ); // Add extra theme styling to the visual editor add_editor_style( array( 'css/editor-style.css', gridbox_google_fonts_url() ) ); } endif; // gridbox_setup add_action( 'after_setup_theme', 'gridbox_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function gridbox_content_width() { $GLOBALS['content_width'] = apply_filters( 'gridbox_content_width', 780 ); } add_action( 'after_setup_theme', 'gridbox_content_width', 0 ); /** * Register widget areas and custom widgets. * * @link http://codex.wordpress.org/Function_Reference/register_sidebar */ function gridbox_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'gridbox' ), 'id' => 'sidebar', 'description' => esc_html__( 'Appears on single posts and pages.', 'gridbox' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => esc_html__( 'Magazine Homepage', 'gridbox' ), 'id' => 'magazine-homepage', 'description' => esc_html__( 'Appears on Magazine Homepage template only. You can use the Magazine Posts widgets here.', 'gridbox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } // gridbox_widgets_init add_action( 'widgets_init', 'gridbox_widgets_init' ); /** * Enqueue scripts and styles. */ function gridbox_scripts() { // Get Theme Version $theme_version = wp_get_theme()->get( 'Version' ); // Register and Enqueue Stylesheet wp_enqueue_style( 'gridbox-stylesheet', get_stylesheet_uri(), array(), $theme_version ); // Register Genericons wp_enqueue_style( 'gridbox-genericons', get_template_directory_uri() . '/css/genericons/genericons.css', array(), '3.4.1' ); // Register and Enqueue HTML5shiv to support HTML5 elements in older IE versions wp_enqueue_script( 'gridbox-html5shiv', get_template_directory_uri() . '/js/html5shiv.min.js', array(), '3.7.3' ); wp_script_add_data( 'gridbox-html5shiv', 'conditional', 'lt IE 9' ); // Register and enqueue navigation.js wp_enqueue_script( 'gridbox-jquery-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20160421' ); // Register and Enqueue Google Fonts wp_enqueue_style( 'gridbox-default-fonts', gridbox_google_fonts_url(), array(), null ); // Register Comment Reply Script for Threaded Comments if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } // gridbox_scripts add_action( 'wp_enqueue_scripts', 'gridbox_scripts' ); /** * Retrieve Font URL to register default Google Fonts */ function gridbox_google_fonts_url() { // Set default Fonts $font_families = array( 'Roboto:400,400italic,700,700italic', 'Roboto Slab:400,400italic,700,700italic' ); // Build Fonts URL $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); return apply_filters( 'gridbox_google_fonts_url', $fonts_url ); } /** * Include Files */ // include Theme Info page require get_template_directory() . '/inc/theme-info.php'; // include Theme Customizer Options require get_template_directory() . '/inc/customizer/customizer.php'; require get_template_directory() . '/inc/customizer/default-options.php'; // Include Extra Functions require get_template_directory() . '/inc/extras.php'; // include Template Functions require get_template_directory() . '/inc/template-tags.php'; // Include support functions for Theme Addons require get_template_directory() . '/inc/addons.php'; // include Widget Files require get_template_directory() . '/inc/widgets/widget-magazine-posts-grid.php';