@version 0.2.2
@since Version 0.1
@todo Check the markup http://validator.w3.org/
For Those About to Rock. Fire!
*/
/**
* Note:
*
* When using a child theme (see http://codex.wordpress.org/Theme_Development and
* http://codex.wordpress.org/Child_Themes), you can override the functions
* wrapped in a function_exists() call) by defining them first in your child theme's
* functions.php file.
*
* The child theme's functions.php file is included before the parent
* theme's file, so the child theme functions would be used.
*/
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 580; /* pixels */
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on Basics, use a find and replace
* to change 'basics' to the name of your theme in all the template files
*/
load_theme_textdomain( 'basics', TEMPLATEPATH . '/languages' );
$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
/**
* This theme uses wp_nav_menu() in four locations.
*/
register_nav_menus( array(
'first' => __( 'First navigation', 'basics' ),
'second' => __( 'Second navigation', 'basics' ),
'third' => __( 'Third navigation', 'basics' ),
'fourth' => __( 'Fourth navigation', 'basics' )
) );
/**
* Add default posts and comments RSS feed links to head
* Don't forget to remove the feed link in header.php if you decomment this line
*/
add_theme_support( 'automatic-feed-links' );
/**
* Add support for all Post Formats.
* Simply comment line(s) associated with the Post formats you want to kick off
*/
add_theme_support(
'post-formats', array(
'aside',
'gallery',
'link',
'image',
'quote',
'status',
'video',
'audio',
'chat'
)
);
/**
* Add support for custom backgrounds
*/
add_custom_background();
/**
* Add support for Thumbnails
*/
add_theme_support( 'post-thumbnails' );
/**
* Add support to styles the visual editor with editor-style.css to match the front theme style
*/
add_editor_style('markup');
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*/
add_filter( 'wp_page_menu_args', 'basics_page_menu_args' );
if ( ! function_exists( 'basics_page_menu_args' ) ) :
function basics_page_menu_args($args) {
$args['show_home'] = true;
return $args;
}
endif;
/**
* Sets the post excerpt length to 52 characters.
*/
add_filter( 'excerpt_length', 'basics_excerpt_length' );
if ( ! function_exists( 'basics_excerpt_length' ) ) :
function basics_excerpt_length( $length ) {
return 52;
}
endif;
/**
* Returns a "Continue Reading" link for excerpts
*/
if ( ! function_exists( 'basics_continue_reading_link' ) ) :
function basics_continue_reading_link() {
return ' ' . __( 'Continue reading →', 'basics' ) . '';
}
endif;
/**
* Replaces "[...]" (appended to automatically generated excerpts)
* with an ellipsis and basics_continue_reading_link().
*/
add_filter( 'excerpt_more', 'basics_auto_excerpt_more' );
if ( ! function_exists( 'basics_auto_excerpt_more' ) ) :
function basics_auto_excerpt_more( $more ) {
return ' …' . basics_continue_reading_link();
}
endif;
/**
* Adds a pretty "Continue Reading" link to custom post excerpts.
*/
add_filter( 'get_the_excerpt', 'basics_custom_excerpt_more' );
if ( ! function_exists( 'basics_custom_excerpt_more' ) ) :
function basics_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= basics_continue_reading_link();
}
return $output;
}
endif;
/**
* Register widgetized area and update sidebar with default widgets
*/
add_action( 'init', 'basics_widgets_init' );
if ( ! function_exists( 'basics_widgets_init' ) ) :
function basics_widgets_init() {
register_sidebar( array (
'name' => __( 'One', 'basics' ),
'id' => 'war-1',
'description' => __( 'Widgets Area One', 'basics' ),
'before_widget' => '
' . sprintf( __( 'You must be logged in to post a comment.','basics' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '