$is_val )
if( $wp_ver[$i] < $is_val ) return false;
return true;
}
if ( ! function_exists( 'boxofboom_setup' ) ):
/**
* Sets up theme defaults and registers support for various WordPress features.
*/
function boxofboom_setup() {
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
*/
load_theme_textdomain( 'box-of-boom', get_template_directory() . '/languages' );
/**
* Add default posts and comments RSS feed links to head
*/
add_theme_support( 'automatic-feed-links' );
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'box-of-boom' ),
) );
add_theme_support('post-thumbnails');
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// custom backgrounds
add_theme_support( 'custom-background', array(
// Background color default
'default-color' => 'e5e5e5',
// Background image default
'default-image' => get_template_directory_uri() . '/library/images/bg-main.jpg',
'wp-head-callback' => '_custom_background_cb'
) );
add_theme_support( 'custom-header', array(
// Header image default
'default-image' => get_template_directory_uri() . '/library/images/headers/header.jpg',
// Header text display default
'header-text' => false,
// Header text color default
'default-text-color' => '000',
// Header image width (in pixels)
'width' => 1024,
// Header image height (in pixels)
'height' => 295
) );
// custom header image
if ( ! function_exists( 'get_custom_header' ) ) {
// header image define
define('NO_HEADER_TEXT', true ); // I prefer no header text, you can change this
// define('HEADER_TEXTCOLOR', 'ffffff'); // the text color in the header ( to use uncomment it and comment no header tx
define('HEADER_IMAGE', '%s/library/images/headers/header.jpg'); // %s is the template dir uri
define('HEADER_IMAGE_WIDTH', 1024); // the width of the logo
define('HEADER_IMAGE_HEIGHT', 295); // the height of the logo
// gets included in the admin header
function admin_header_style() {
?> tag in the post content as the external link for that post. An alternative approach could be if the post consists only of a URL, then that will be the URL and the title (post_title) will be the name attached to the anchor for it */
'image', /* A single image. The first tag in the post could be considered the image. Alternatively, if the post consists only of a URL, that will be the image URL and the title of the post (post_title) will be the title attribute for the image */
'quote', /* A quotation. Probably will contain a blockquote holding the quote content. Alternatively, the quote may be just the content, with the source/author being the title */
'status', /*A short status update, similar to a Twitter status update */
'video', /* A single video. The first tag or object/embed in the post content could be considered the video. Alternatively, if the post consists only of a URL, that will be the video URL. May also contain the video as an attachment to the post, if video support is enabled on the blog (like via a plugin) */
'audio', /* An audio file. Could be used for Podcasting */
'chat' /* A chat transcript */
)
);
}
endif;
add_action( 'after_setup_theme', 'boxofboom_setup' );
/**
* Title filter
*/
function boxofboom_filter_wp_title( $title ) {
// Get the Site Name
$site_name = get_bloginfo( 'name' );
// Prepend name
$filtered_title = $site_name . $title;
// Get the Site Description
$site_description = get_bloginfo( 'description' );
// Append Site Description to title
if ( $site_description && ( is_home() || is_front_page() ) ) {
$filtered_title = $site_name . ' | ' . $site_description;
}
// Return the modified title
return $filtered_title;
}
// Hook into 'wp_title'
add_filter( 'wp_title', 'boxofboom_filter_wp_title' );
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*/
if ( ! function_exists( 'boxofboom_main_nav' ) ) :
function boxofboom_main_nav() {
// display the wp3 menu if available
wp_nav_menu(
array(
'menu' => 'primary', /* menu name */
'theme_location' => 'primary', /* where in the theme it's assigned */
'container_class' => 'menu', /* container class */
'fallback_cb' => 'boxofboom_main_nav_fallback' /* menu fallback */
)
);
}
endif;
if ( ! function_exists( 'boxofboom_main_nav_fallback' ) ) :
function boxofboom_main_nav_fallback() { wp_page_menu( 'show_home=Home&menu_class=menu' ); }
endif;
function boxofboom_enqueue_comment_reply() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'boxofboom_enqueue_comment_reply' );
function boxofboom_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'boxofboom_page_menu_args' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function boxofboom_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar 1', 'box-of-boom' ),
'id' => 'sidebar-1',
'description' => 'The right sidebar.',
'before_widget' => '",
'before_title' => '