.
*/
/* Register Candid's features. */
// This is the main sidebar, next to the posts column.
register_sidebar( array(
'name' => __('Main Sidebar', 'candid'),
'id' => 'main-sidebar',
'description' => __( 'The sidebar next to the main content', 'candid' ),
) );
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
set_post_thumbnail_size( 140, 140, true );
add_custom_background();
add_editor_style();
/* We register our menus here. */
register_nav_menus( array(
'main-nav' => __( 'Main navigation', 'candid' ),
'footer-nav' => __( 'Footer links', 'candid' ),
) );
/* Enable translations */
load_theme_textdomain('candid', TEMPLATEPATH . '/languages');
/**
* Filters navigation display for paged entries.
*
* @param the argument array to wp_link_pages
* @return the filtered argument array to wp_link_pages
*/
function candid_filter_wp_link_pages_args( $args ) {
$args['before'] = '
' . __( 'Page', 'candid' ) . '';
$args['after'] = '
';
return $args;
}
add_filter('wp_link_pages_args', 'candid_filter_wp_link_pages_args');
/**
* Optimizes tag content for SEO.
*
* @param the title generated by wp_title
* @param the separator used by wp_title
* @return the new title
*/
function candid_filter_wp_title( $title, $separator ) {
if ( is_feed() )
return $title;
$title .= get_bloginfo('name', 'display');
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && is_home() || is_front_page() ) {
$title .= " $separator " . $site_description;
}
return $title;
}
add_filter('wp_title', 'candid_filter_wp_title', 10, 2);
/**
* Removes the inline style from a post gallery.
*
* This allows us to style the gallery in our style.css.
*
* @param the gallery markup generated by WordPress
* @return the gallery markup, without inline style
*/
function candid_remove_gallery_css( $markup ) {
return preg_replace( "##s", '', $markup );
}
add_filter( 'gallery_style', 'candid_remove_gallery_css' );
/**
* Displays a default title for entries without a title.
*
* @param the original title
* @return the new title
*/
function candid_default_entry_title( $title ) {
if ( ! empty($title) ) {
return $title;
} else {
return __( '(no title)', 'candid' );
}
}
add_filter( 'the_title', 'candid_default_entry_title' );
if ( ! function_exists( 'candid_navigation' ) ) :
/**
* Prints the navigation links.
*
* If there is only one page, the navigation links are not printed.
*/
function candid_navigation() {
global $wp_query;
if ( $wp_query->max_num_pages > 1) :
?>
is_single ) :
?>
%s', $title );
}
}
endif;
if ( ! function_exists( 'candid_posted_by' ) ) :
/**
* Prints an entry's author and date.
*/
function candid_posted_by() {
?>