__( 'Primary Menu', 'the-box' ), 'secondary' => __( 'Footer Menu', 'the-box' ) ) ); // Enable support for Post Formats add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); // Custom template tags for this theme require get_template_directory() . '/inc/template-tags.php'; // Theme Customizer require get_template_directory() . '/inc/customizer.php'; // Set up the WordPress Custom Background Feature. add_theme_support( 'custom-background', apply_filters( 'thebox_custom_background_args', array( 'default-color' => 'f0f3f5', 'default-image' => '', ) ) ); // Load Jetpack compatibility file require get_template_directory() . '/inc/jetpack.php'; } endif; add_action( 'after_setup_theme', 'thebox_setup' ); /** * Enqueue scripts and styles for the front end. * */ function thebox_scripts() { // Add Google Fonts, used in the main stylesheet. wp_enqueue_style( 'thebox-fonts', thebox_fonts_url(), array(), null ); // Add Icons Font, used in the main stylesheet. wp_enqueue_style( 'thebox-icons', get_template_directory_uri() . '/fonts/fa-icons.css', array(), '1.7' ); // Loads main stylesheet. wp_enqueue_style( 'thebox-style', get_stylesheet_uri(), array(), '1.4.5' ); wp_enqueue_script( 'thebox-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'thebox_scripts' ); /** * Return the Google font stylesheet URL, if available. * * @return string Font stylesheet or empty string if disabled. * */ function thebox_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by the font, translate this to 'off'. Do not translate * into your own language. */ $heading_font = _x( 'on', 'Source Sans Pro font: on or off', 'the-box' ); /* Translators: If there are characters in your language that are not * supported by the font, translate this to 'off'. Do not translate * into your own language. */ $text_font = _x( 'on', 'Oxygen font: on or off', 'the-box' ); if ( 'off' !== $heading_font || 'off' !== $text_font ) { $font_families = array(); if ( 'off' !== $heading_font ) $font_families[] = 'Source Sans Pro:400,700,400italic,700italic'; if ( 'off' !== $text_font ) $font_families[] = 'Oxygen:300,400,700'; $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 $fonts_url; } /** * Enqueue Google fonts style to admin screen for custom header display. * */ function thebox_admin_fonts() { wp_enqueue_style( 'thebox-admin-fonts', thebox_fonts_url(), array(), null ); } add_action( 'admin_print_scripts-appearance_page_custom-header', 'thebox_admin_fonts' ); /** * Helper function for getting the script/style `.min` suffix for minified files. * */ function thebox_get_min_suffix() { return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; } /** * Filters the 'stylesheet_uri' to allow theme developers to offer a minimized version of their main * 'style.css' file. It will detect if a 'style.min.css' file is available and use it if SCRIPT_DEBUG * is disabled. * * from Hybrid Core, Copyright Justin Tadlock. */ function thebox_min_stylesheet_uri( $stylesheet_uri, $stylesheet_dir_uri ) { /* Get the minified suffix. */ $suffix = thebox_get_min_suffix(); /* Use the .min stylesheet if available. */ if ( !empty( $suffix ) ) { /* Remove the stylesheet directory URI from the file name. */ $stylesheet = str_replace( trailingslashit( $stylesheet_dir_uri ), '', $stylesheet_uri ); /* Change the stylesheet name to 'style.min.css'. */ $stylesheet = str_replace( '.css', "{$suffix}.css", $stylesheet ); /* If the stylesheet exists in the stylesheet directory, set the stylesheet URI to the dev stylesheet. */ if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $stylesheet ) ) $stylesheet_uri = trailingslashit( $stylesheet_dir_uri ) . $stylesheet; } /* Return the theme stylesheet. */ return $stylesheet_uri; } /* Load the development stylsheet in script debug mode. */ add_filter( 'stylesheet_uri', 'thebox_min_stylesheet_uri', 5, 2 ); /** * Register widgetized area and update sidebar with default widgets * */ function thebox_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar Primary', 'the-box' ), 'id' => 'sidebar-1', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer', 'the-box' ), 'id' => 'sidebar-2', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'thebox_widgets_init' ); /** * Implement the Custom Header feature * */ require( get_template_directory() . '/inc/custom-header.php' ); /* * Social Links * */ function thebox_social_links() { // Backward compatibility for Theme versions older than 4.1.3 if ( get_option( 'thebox_theme_options' ) ) { // Retro compatibility for versions older than 4.1.3 $options = get_option( 'thebox_theme_options', '' ); // Old Theme Options Page Values $facebook_url = get_option('facebook_url', $options['facebookurl'] ); $twitter_url = get_option('twitter_url', $options['twitterurl'] ); $googleplus_url = get_option('googleplus_url', $options['googleplusurl'] ); $linkedin_url = get_option('linkedin_url', $options['linkedinurl'] ); $instagram_url = get_option('instagram_url', $options['instagramurl'] ); $youtube_url = get_option('youtube_url', $options['youtubeurl'] ); $pinterest_url = get_option('pinterest_url', $options['pinteresturl'] ); $stumbleupon_url = get_option('stumbleupon_url', $options['stumbleuponurl'] ); $flickr_url = get_option('flickr_url', $options['flickrurl'] ); $tumblr_url = get_option('tumblr_url', $options['tumblrurl'] ); $medium_url = get_option('medium_url', $options['mediumurl'] ); $github_url = get_option('github_url', $options['githuburl'] ); } else { $facebook_url = get_option('facebook_url', ''); $twitter_url = get_option('twitter_url', ''); $googleplus_url = get_option('googleplus_url', ''); $linkedin_url = get_option('linkedin_url', ''); $instagram_url = get_option('instagram_url', ''); $youtube_url = get_option('youtube_url', ''); $pinterest_url = get_option('pinterest_url', ''); $stumbleupon_url = get_option('stumbleupon_url', ''); $flickr_url = get_option('flickr_url', ''); $tumblr_url = get_option('tumblr_url', ''); $medium_url = get_option('medium_url', ''); $github_url = get_option('github_url', ''); } $xing_url = get_option('xing_url', ''); echo '