'
', 'before_link' => '
  • ', 'after_link' => '
  • ', 'current_before' => '
  • ', 'current_after' => '
  • ', 'link_before' => '', 'link_after' => '', 'pagelink' => '%', 'echo' => 1 ); $r = wp_parse_args( $args, $defaults ); $r = apply_filters( 'wp_link_pages_args', $r ); extract( $r, EXTR_SKIP ); global $page, $numpages, $multipage, $more, $pagenow; if ( ! $multipage ) { return; } $output = $before; for ( $i = 1; $i < ( $numpages + 1 ); $i++ ) { $j = str_replace( '%', $i, $pagelink ); $output .= ' '; if ( $i != $page || ( ! $more && 1 == $page ) ) { $output .= "{$before_link}" . _wp_link_page( $i ) . "{$link_before}{$j}{$link_after}{$after_link}"; } else { $output .= "{$current_before}{$link_before}{$j}{$link_after}{$current_after}"; } } print $output . $after; } add_filter( 'wp_link_pages', 'biru_link_pages' ); /** * Generate custom search form. */ function biru_search_form( $form ) { $form = ''; return $form; } add_filter( 'get_search_form', 'biru_search_form' ); if ( ! function_exists( 'biru_post_date' ) ) : /** * Prints HTML with meta information for the current post-date/time. */ function biru_post_date() { $time_string = ''; $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $posted_on = sprintf( esc_html_x( '%s', 'post date', 'biru' ), '' . $time_string . '' ); echo '' . $posted_on . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'biru_post_author' ) ) : /** * Prints HTML with meta information for the current post author. */ function biru_post_author() { $byline = sprintf( esc_html_x( '%s', 'post author', 'biru' ), '' . esc_html( get_the_author() ) . '' ); echo '' . $byline . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'biru_post_cat' ) ) : /** * Prints HTML with meta information for the current post categories. */ function biru_post_cat() { if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ' / ', 'biru' ) ); if ( $categories_list && biru_categorized_blog() ) { printf( '' . esc_html__( '%1$s', 'biru' ) . '', $categories_list ); // WPCS: XSS OK. } } } endif; if ( ! function_exists( 'biru_post_comment' ) ) : /** * Prints HTML with meta information for the current post comment(s). */ function biru_post_comment() { if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; /* translators: %s: post title */ comments_popup_link( 'No Comments', '1 Comment', '% Comments', 'comments-link', 'Comments are off for this post' ); echo ''; } } endif; /** * Prints HTML with author information of the current post. */ function biru_authorbox() { echo '
    '; echo '
    '; echo '
    ' . get_avatar( get_the_author_meta( 'user_email' ), 75 ) . '
    '; echo '
    '; echo '

    ' . get_the_author_meta( 'display_name' ) . '

    '; echo '

    ' . the_author_meta( 'description' ) . '

    '; echo '
    '; echo '
    '; echo '
    '; } if ( ! function_exists( 'biru_entry_footer' ) ) : /** * Prints HTML with meta information for the tags. */ function biru_entry_tags() { if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html__( ' ', 'biru' ) ); if ( $tags_list ) { printf( '' . esc_html__( '%1$s', 'biru' ) . '', $tags_list ); // WPCS: XSS OK. } } } endif; /** * Returns true if a blog has more than 1 category. */ function biru_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'biru_categories' ) ) ) { $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, 'number' => 2, ) ); $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'biru_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { return true; } else { return false; } } /** * Flush out the transients used in biru_categorized_blog. */ function biru_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } delete_transient( 'biru_categories' ); } add_action( 'edit_category', 'biru_category_transient_flusher' ); add_action( 'save_post', 'biru_category_transient_flusher' );