', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'blogbit_pingback_header' ); // Numbered Pagination function blogbit_pagination() { if( is_singular() ) return; global $wp_query; /** Stop execution if there's only 1 page */ if( $wp_query->max_num_pages <= 1 ) return; $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; $max = intval( $wp_query->max_num_pages ); /** Add current page to the array */ if ( $paged >= 1 ) $links[] = $paged; /** Add the pages around the current page to the array */ if ( $paged >= 3 ) { $links[] = $paged - 1; $links[] = $paged - 2; } if ( ( $paged + 2 ) <= $max ) { $links[] = $paged + 2; $links[] = $paged + 1; } echo '
' . '
', 'comment' => '' . '
', ]; return $fields; } add_filter( 'comment_form_fields', 'comment_field_to_bottom', 10, 1 ); /** * Filter the categories archive widget to add a span around post count */ if ( ! function_exists( 'blogbit_cat_count_span' ) ) { function blogbit_cat_count_span( $links ) { $links = str_replace( ' (', '(', $links ); $links = str_replace( ')', ')', $links ); return $links; } } add_filter( 'wp_list_categories', 'blogbit_cat_count_span' ); /** * Filter the archives widget to add a span around post count */ if ( ! function_exists( 'blogbit_archive_count_span' ) ) { function blogbit_archive_count_span( $links ) { $links = str_replace( ' (', '(', $links ); $links = str_replace( ')', ')', $links ); return $links; } } add_filter( 'get_archives_link', 'blogbit_archive_count_span' ); /** * POst reading time count */ function reading_time() { $content = get_post_field( 'post_content', $post->ID ); $word_count = str_word_count( strip_tags( $content ) ); $readingtime = ceil($word_count / 200); if ($readingtime == 1) { $timer = " minute"; } else { $timer = " minutes"; } $totalreadingtime = $readingtime . $timer; return $totalreadingtime; } /** * Excerpt Limit */ // 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; // } /** * title Limit */