Version ) ); define( 'BAVOTASAN_THEME_NAME', $bavotasan_theme_data->Name ); define( 'BAVOTASAN_THEME_FILE', get_option( 'template' ) ); /** * Includes * * @since 1.0.0 */ require( BAVOTASAN_THEME_TEMPLATE . '/library/customizer.php' ); // Functions for theme options page require( BAVOTASAN_THEME_TEMPLATE . '/library/about.php' ); // Functions for about page require( BAVOTASAN_THEME_TEMPLATE . '/library/preview-pro.php' ); // Functions for preview pro page /** * Prepare the content width * * @since 1.0.0 */ $bavotasan_theme_options = bavotasan_theme_options(); $array_width = array( '' => 1200, 'w960' => 960, 'w640' => 640, 'w320' => 320, 'wfull' => 1200 ); $array_content = array( 'c2' => .17, 'c3' => .25, 'c4' => .34, 'c5' => .42, 'c6' => .5, 'c7' => .58, 'c8' => .66, 'c9' => .75, 'c10' => .83, 'c12' => 1 ); $bavotasan_main_content = $array_content[$bavotasan_theme_options['primary']] * $array_width[$bavotasan_theme_options['width']] - 40; if ( ! isset( $content_width ) ) $content_width = $bavotasan_main_content; add_action( 'after_setup_theme', 'bavotasan_setup' ); if ( ! function_exists( 'bavotasan_setup' ) ) : /** * Initial setup * * This function is attached to the 'after_setup_theme' action hook. * * @uses load_theme_textdomain() * @uses get_locale() * @uses BAVOTASAN_THEME_TEMPLATE * @uses add_theme_support() * @uses add_editor_style() * @uses add_custom_background() * @uses add_custom_image_header() * @uses register_default_headers() * * @since 1.0.0 */ function bavotasan_setup() { load_theme_textdomain( 'tonic', BAVOTASAN_THEME_TEMPLATE . '/library/languages' ); // Add default posts and comments RSS feed links to
. add_theme_support( 'automatic-feed-links' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'tonic' ) ); // Add support for a variety of post formats add_theme_support( 'post-formats', array( 'gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside' ) ); // This theme uses Featured Images (also known as post thumbnails) for archive pages add_theme_support( 'post-thumbnails' ); // Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header. add_theme_support( 'custom-header', array( 'default-text-color' => 'fff', 'flex-height' => true, 'flex-width' => true, 'random-default' => true, 'width' => apply_filters( 'bavotasan_header_image_width', 1500 ), 'height' => apply_filters( 'bavotasan_header_image_height', 550 ), 'admin-head-callback' => 'bavotasan_admin_header_style', 'admin-preview-callback' => 'bavotasan_admin_header_image' ) ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'header01' => array( 'url' => '%s/library/images/header01.jpg', 'thumbnail_url' => '%s/library/images/header01-thumbnail.jpg', 'description' => __( 'Default Header 1', 'tonic' ) ), ) ); // Add support for custom backgrounds add_theme_support( 'custom-background' ); // Add title tag support add_theme_support( 'title-tag' ); // Add HTML5 elements add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', ) ); // Remove default gallery styles add_filter( 'use_default_gallery_style', '__return_false' ); } endif; // bavotasan_setup add_action( 'wp_head', 'bavotasan_styles' ); /** * Add a style block to the theme for the current link color. * * This function is attached to the 'wp_head' action hook. * * @since 1.0.0 */ function bavotasan_styles() { $bavotasan_theme_options = bavotasan_theme_options(); $text_color = get_header_textcolor(); $styles = ( 'blank' == $text_color ) ? 'position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px)' : 'color:#' . $text_color . ' !important'; ?> add_node( array( 'id' => 'bavotasan_toolbar', 'title' => BAVOTASAN_THEME_NAME, 'href' => esc_url( admin_url( 'customize.php' ) ) ) ); } if ( ! function_exists( 'bavotasan_admin_header_style' ) ) : /** * Styles the header image displayed on the Appearance > Header admin panel. * * Referenced via add_custom_image_header() in bavotasan_setup(). * * @since 1.0.0 */ function bavotasan_admin_header_style() { $text_color = get_header_textcolor(); $styles = ( 'blank' == $text_color ) ? 'display:none' : 'color:#' . $text_color . ' !important'; ?> Header admin panel. * * Referenced via add_custom_image_header() in bavotasan_setup(). * * @uses bloginfo() * @uses get_header_image() * * @since 1.0.0 */ function bavotasan_admin_header_image() { ?>