. */ /* 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( "#<style type='text/css'>(.*?)</style>#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) : ?> <div class="navigation"> <div class="nav-previous"><?php previous_posts_link( __( '< Previous', 'candid' ) ); ?></div> <div class="nav-next"><?php next_posts_link( __( 'Next >', 'candid' ) ); ?></div> </div> <?php endif; if ( $wp_query->is_single ) : ?> <div class="navigation"> <div class="nav-previous"><?php previous_post_link( '%link', __( '< Previous', 'candid' ) ); ?></div> <div class="nav-next"><?php next_post_link( '%link', __( 'Next >', 'candid' ) ); ?></div> </div> <?php endif; } endif; if ( ! function_exists( 'candid_display_title' ) ) : /** * Prints the title for an index page, as appropriate to the index type. */ function candid_display_title() { $title = ''; if ( is_category() ) { $title = single_cat_title('', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } elseif ( is_search() ) { $title = __( 'Search results for', 'candid' ) . ' ' . get_search_query(); } if ( $title ) { printf( '<h1 id="page-title">%s</h1>', $title ); } } endif; if ( ! function_exists( 'candid_posted_by' ) ) : /** * Prints an entry's author and date. */ function candid_posted_by() { ?> <div class="posted-by entry-utility"> <?php _e( 'Posted by', 'candid' ); ?> <span class="author"><?php the_author_posts_link(); ?></span> <?php the_date(); ?> </div> <?php } endif; if ( ! function_exists( 'candid_classification' ) ) : /** * Prints an entry's category and tags. */ function candid_classification() { ?> <ul class="entry-utility"> <li><?php _e( 'in', 'precedes category list', 'candid' ); ?> <?php the_category(', '); ?></li> <li><?php the_tags(); ?></li> </ul> <?php } endif; ?>