max_num_pages < 2 ) { return; } ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> %2$s'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string .= ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); printf( __( 'Posted on %1$s by %2$s', 'blogbox' ), sprintf( '%2$s', esc_url( get_permalink() ), $time_string ), sprintf( '%2$s', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ) ); } endif; function blogbox_part_author_info() { ?>

'; _e( 'Home', 'blogbox' ); echo " » "; if (is_category() || is_single()) { single_cat_title(); if (is_single()) { the_category(', '); echo " » "; the_title(); } } elseif (is_page()) { echo the_title(); } elseif (is_tag()) { echo 'Posts tagged with "'; single_tag_title(); echo '"'; } elseif (is_day()) {echo "Archive for "; the_time(' F jS, Y');} elseif (is_month()) {echo "Archive for "; the_time(' F, Y');} elseif (is_year()) {echo "Archive for "; the_time(' Y');} elseif (is_author()) {echo "Author Archive";} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "Blog Archives";} elseif (is_search()) {echo "Search Results";} } } /** * Returns true if a blog has more than 1 category. * * @return bool */ function blogbox_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'blogbox_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'blogbox_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so blogbox_categorized_blog should return true. return true; } else { // This blog has only 1 category so blogbox_categorized_blog should return false. return false; } } /** * Flush out the transients used in blogbox_categorized_blog. */ function blogbox_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'blogbox_categories' ); } add_action( 'edit_category', 'blogbox_category_transient_flusher' ); add_action( 'save_post', 'blogbox_category_transient_flusher' );