__( 'Right Sidebar', '' ),
'id' => 'sidebar',
'description' => __( 'Widgets in this area will be shown on the right-hand side.', '' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
));
register_sidebar(array(
'name' => __( 'Below Posts' , '' ),
'id' => 'belowposts-sidebar',
'description' => __( 'Widgets in this area will be shown beneath the blog post type. Use this for sharing, related articles and more.' , '' ),
'before_title' => '',
'before_widget' => '',
'after_widget' => '
',
));
/* Misc */
function customTitle($limit) {
$title = get_the_title($post->ID);
$title = substr($title, 45, $limit) . '...';
echo $title;
}
function add_nofollow_cat( $text ) {
$text = str_replace('rel="category"', '', $text);
$text = str_replace('rel="category tag"', 'rel="tag"', $text);
return $text;
}
add_filter( 'the_category', 'add_nofollow_cat' );
function new_excerpt_more($more) {
global $post;
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');
add_filter('the_title', 'blank_slate_title');
function blank_slate_title($title) {
if ($title == '') {
return 'Untitled Post';
} else {
return $title;
}
}
function custom_excerpt_length( $length ) {
return 30;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
/* Four Column Custom Excerpt */
function excerpt($limit) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`[[^]]*]`','',$excerpt);
return $excerpt;
}
function content($limit) {
$content = explode(' ', get_the_content(), $limit);
if (count($content)>=$limit) {
array_pop($content);
$content = implode(" ",$content).'...';
} else {
$content = implode(" ",$content);
}
$content = preg_replace('/[.+]/','', $content);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
return $content;
}
/* Twenty Twelve Comments*/
if ( ! function_exists( 'twentytwelve_comment' ) ) :
/**
* Template for comments and pingbacks.
* To override this walker in a child theme without modifying the comments template
* simply create your own twentytwelve_comment(), and that function will be used instead.
* Used as a callback by wp_list_comments() for displaying the comments.
* @since Twenty Twelve 1.0
*/
function twentytwelve_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>
id="comment-">
', '' ); ?>
id="li-comment-">
= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'Page %s', '' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'bartleby_wp_title', 10, 2 );