max_num_pages <= 1 ) return; $previous_post_label = __('Previous', 'anaglyph-lite'); $next_post_label = __('Next', 'anaglyph-lite'); $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; $max = intval( $wp_query->max_num_pages ); if ( $paged >= 1 ) $links[] = $paged; if ( $paged >= 3 ) { $links[] = $paged - 1; $links[] = $paged - 2; } if ( ( $paged + 2 ) <= $max ) { $links[] = $paged + 2; $links[] = $paged + 1; } $gen_nav_text = '
'; echo $gen_nav_text; } endif; if ( ! function_exists( 'anaglyph_post_nav' ) ) : /** * Display navigation to next/previous post when applicable. * * @since Anaglyph Theme 1.0 * * @return void */ function anaglyph_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> 1, ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'anaglyph_category_count', $all_the_cool_cats ); } if ( 1 !== (int) $all_the_cool_cats ) { // This blog has more than 1 category so anaglyph_categorized_blog should return true return true; } else { // This blog has only 1 category so anaglyph_categorized_blog should return false return false; } } /** * Flush out the transients used in anaglyph_categorized_blog. * * @since Anaglyph Theme 1.0 * * @return void */ function anaglyph_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'anaglyph_category_count' ); } add_action( 'edit_category', 'anaglyph_category_transient_flusher' ); add_action( 'save_post', 'anaglyph_category_transient_flusher' );