__( 'Primary Menu', 'thebox' ) ) ); // Enable support for Post Formats add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); } 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/icons-font.css', array(), '1.4' ); // Loads main stylesheet. wp_enqueue_style( 'thebox-style', get_stylesheet_uri(), array(), '1.3.8' ); 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', 'thebox' ); /* 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', 'thebox' ); 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' ); /** * Register widgetized area and update sidebar with default widgets * */ function thebox_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar Primary', 'thebox' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer', 'thebox' ), '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' ); /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions */ require get_template_directory() . '/inc/customizer.php'; /** * Theme Options additions */ require get_template_directory() . '/inc/theme-options.php'; /** * Load Jetpack compatibility file * */ require( get_template_directory() . '/inc/jetpack.php' ); /** * Setup the WordPress core custom background feature. * */ function thebox_register_custom_background() { $args = array( 'default-color' => 'f0f3f5', 'default-image' => '', ); $args = apply_filters( 'thebox_custom_background_args', $args ); add_theme_support( 'custom-background', $args ); } add_action( 'after_setup_theme', 'thebox_register_custom_background' ); /* * Change excerpt text * */ function thebox_excerpt($num) { global $post; $limit = $num+1; $excerpt = explode(' ', get_the_excerpt(), $limit); array_pop($excerpt); $excerpt = implode(" ",$excerpt)."...
".__('Read more', 'thebox')." »"; echo $excerpt; } /* * Prints Credits in the Footer * */ function thebox_credits() { $website_credits = ''; $website_author = get_bloginfo('name'); $website_date = date ('Y'); $website_credits = esc_attr( '© ' . $website_date . ' ' . $website_author ); echo $website_credits; } /** * Custom Pagination * */ if ( ! function_exists('thebox_pagination') ) { function thebox_pagination() { global $wp_query; $total = $wp_query->max_num_pages; $big = 999999999; // need an unlikely integer if( $total > 1 ) { if( !$current_page = get_query_var('paged') ) $current_page = 1; if( get_option('permalink_structure') ) { $format = 'page/%#%/'; } else { $format = '&paged=%#%'; } echo paginate_links(array( 'base' => str_replace( $big, '%#%', get_pagenum_link( $big, false ) ), 'format' => $format, 'current' => max( 1, get_query_var('paged') ), 'total' => $total, 'mid_size' => 3, 'type' => 'list', 'prev_text' => '«', 'next_text' => '»', )); } } } /** * Update to Plus Version * */ if(is_admin()){ if(!get_option('thebox_basic_notice')){ add_action('admin_notices', 'thebox_basic_notice'); add_action('wp_ajax_thebox_hide_notice', 'thebox_hide_notice'); function thebox_basic_notice(){ ?>

Upgrade to The Box Plus version to get extended functionality and advanced customization options: %1$s', 'thebox'), sprintf('%s', 'Try The Box Plus') ); ?>