init(array(
'theme_name' => 'Tenacity', // Change this to the name of the theme.
'theme_slug' => 'tenacity' // Create a custom slug for the theme.
));
/**
* Add Theme-Specific Stuff Below Here
*****************************************/
/**
* Defines content width
**/
if (!isset($content_width)) {
$content_width = 620; // Let this to the proper content width
}
/**
* Custom Sidebars
*
* Uncomment below and duplicate as needed.
* The default sidebar is in the framework.
**/
// Register footer-col1
register_sidebar(array(
'id' => 'footer-col1',
'name' => 'Footer Column 1',
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
// Register footer-col2
register_sidebar(array(
'id' => 'footer-col2',
'name' => 'Footer Column 2',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Register footer-col3
register_sidebar(array(
'id' => 'footer-col3',
'name' => 'Footer Column 3',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Register footer-col4
register_sidebar(array(
'id' => 'footer-col4',
'name' => 'Footer Column 4',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
/**
* Custom Post Thumbnail Size
*
* @since Tenacity 1.0
**/
add_image_size('post-thumbnails', 610, 200, true); // Adds "post-thumbnails" size
/**
* Custom Excerpt Length
*
* Uncomment and change as necessary.
*
* @since Ilmenite 1.0
**/
/*
function new_excerpt_length($length) {
return 200; // Sets the excerpt length (in words)
}
add_filter('excerpt_length', 'new_excerpt_length');
*/
/**
* Adds support for custom image header
*
* @since Tenacity 1.0
**/
// The default header text color
define('NO_HEADER_TEXT', true );
define( 'HEADER_TEXTCOLOR', '' );
// By leaving empty, we allow for random image rotation.
define( 'HEADER_IMAGE', '' );
// The height and width of your custom header.
// Add a filter to tenacity_header_image_width and tenacity_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'tenacity_header_image_width', 960 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'tenacity_header_image_height', 300 ) );
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be the size of the header image that we just defined
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Used for large feature (header) images
add_image_size( 'small-feature', 960, 300 ); // Used for featured posts if a large-feature doesn't exist
// Turn on random header image rotation by default.
add_theme_support( 'custom-header', array( 'random-default' => true ) );
// Add a way for the custom header to be styled in the admin panel that controls
// custom headers. See tenacity_admin_header_style(), below.
add_custom_image_header( 'tenacity_header_style', 'tenacity_admin_header_style', 'tenacity_admin_header_image' );
// ... and thus ends the changeable header business.
// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
register_default_headers( array(
'cityscape' => array(
'url' => trailingslashit( get_stylesheet_directory_uri() ).'/images/header-default/cityscape.jpg',
'thumbnail_url' => trailingslashit( get_stylesheet_directory_uri() ).'/images/header-default/cityscape-thumb.jpg',
/* translators: header image description */
'description' => __( 'Cityscape', 'tenacity' )
),
'fall-leaves' => array(
'url' => trailingslashit( get_stylesheet_directory_uri() ).'/images/header-default/fall-leaves.jpg',
'thumbnail_url' => trailingslashit( get_stylesheet_directory_uri() ).'/images/header-default/fall-leaves-thumb.jpg',
/* translators: header image description */
'description' => __( 'Fall Leaves', 'tenacity' )
),
'waterfall' => array(
'url' => trailingslashit( get_stylesheet_directory_uri() ).'/images/header-default/waterfall.jpg',
'thumbnail_url' => trailingslashit( get_stylesheet_directory_uri() ).'/images/header-default/waterfall-thumb.jpg',
/* translators: header image description */
'description' => __( 'Waterfall', 'tenacity' )
)
) );
if ( ! function_exists( 'tenacity_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @since Twenty Eleven 1.0
*/
function tenacity_header_style() {
// If no custom options for text are set, let's bail
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
if ( HEADER_TEXTCOLOR == get_header_textcolor() )
return;
// If we get this far, we have custom styles. Let's do this.
?>
Header admin panel.
*
* Referenced via add_custom_image_header() in tenacity_setup().
*
* @since Tenacity 1.0
*/
function tenacity_admin_header_style() {
?>
Header admin panel.
*
* Referenced via add_custom_image_header() in tenacity_setup().
*
* @since Tenacity 1.0
*/
function tenacity_admin_header_image() { ?>
comment_type ) :
case 'pingback' :
case 'trackback' :
?>
', '' ); ?>
id="li-comment-">