= 2 || $page >= 2 ) {
$mytitle = "$mytitle $separated " . sprintf( __( 'Page %s', 'bluesip' ), max( $paged, $page ) );
}
return $mytitle;
}
if ( ! function_exists( 'bluesip_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*
* @since bluesip 1.0
*/
function bluesip_posted_on() {
printf( __( 'Posted on by %7$s', 'bluesip' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'bluesip' ), get_the_author() ) ),
esc_html( get_the_author() )
);
}
endif;
if ( ! function_exists( 'bluesip_date_posts' ) ) :
/**
* Prints HTML for the current post-date in index
*
* See http://codex.wordpress.org/Formatting_Date_and_Time
*
* @since bluesip 1.0
*/
function bluesip_date_posts() {
printf( __('
%1$s
%2$s
', 'bluesip'),
esc_html( get_the_date( 'j' ) ),
esc_html( get_the_date( 'M' ) )
);
}
endif;
if ( ! function_exists( 'bluesip_show_avatar' ) ) :
/**
* Show the Avatar of Author for the current post
*
* See http://codex.wordpress.org/Function_Reference/get_avatar
*
* @since bluesip 1.0
*/
function bluesip_show_avatar() {
printf( __('
%1$s
', 'bluesip'),
get_avatar( get_the_author_meta( 'ID' ), 64 )
);
}
endif;
if ( ! function_exists( 'bluesip_posted_author' ) ) :
/**
* Prints HTML with meta information for author in index posts.
*
* @since bluesip 1.0
*/
function bluesip_posted_author() {
printf( __( 'Posted by %3$s', 'bluesip' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'bluesip' ), get_the_author() ) ),
esc_html( get_the_author() )
);
}
endif;
/**
* Returns true if a blog has more than 1 category
*
* @since Shape 1.0
*/
function bluesip_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {
// Create an array of all the categories that are attached to posts
$all_the_cool_cats = get_categories( array(
'hide_empty' => 1,
) );
// Count the number of categories that are attached to the posts
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'all_the_cool_cats', $all_the_cool_cats );
}
if ( '1' != $all_the_cool_cats ) {
// With more than 1 category
return true;
} else {
// if this blog has only 1 category
return false;
}
}
/**
* Flush out the transients used in bluesip_categorized_blog
*
* @since bluesip 1.0
*/
function bluesip_category_transient_flusher() {
// Like, beat it. Dig?
delete_transient( 'all_the_cool_cats' );
}
add_action( 'edit_category', 'bluesip_category_transient_flusher' );
add_action( 'save_post', 'bluesip_category_transient_flusher' );
/**
* Register widgetized area and update sidebar with default widgets
*
* @since bluesip 1.0
*/
function bluesip_widgets_init() {
register_sidebar( array(
'name' => __( 'Primary Widget Area', 'bluesip' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '