found_posts; $type = ( isset( $query->query['post_type'] ) ) ? $query->query['post_type'] : 'post'; $paged = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1; $posts_per_page = $query->query_vars['posts_per_page']; $current_page_count = ( 1 == $paged ) ? '1-' . $paged * $posts_per_page : ( $paged - 1 ) * $posts_per_page + 1 . '-' . $paged * $posts_per_page; $current_page_count = ( $query->max_num_pages == $paged ) ? ( $paged - 1 ) * $posts_per_page + 1 . '-' . $query->found_posts : $current_page_count; printf( __( '%1$s%2$s of %3$s results for "%4$s"', 'abacus'), esc_attr( ucfirst( $type . 's' ) ), $current_page_count, absint( $query->found_posts ), esc_html( get_search_query() ) ); } function abacus_search_pagination( $query ) { $max_page = $query->max_num_pages; $paged = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1; $type = ( isset( $query->query['post_type'] ) ) ? $query->query['post_type'] : 'post'; $prev_search_post_type = ( 2 == $paged ) ? '' : '&search_post_type=' . esc_attr( $type ); $next_post_link = str_replace( '&search_post_type=' . esc_attr( $type ), '', next_posts( $max_page, false ) ); $prev_post_link = str_replace( '&search_post_type=' . esc_attr( $type ), '', previous_posts( false ) ); $prev_label = ( 2 == $paged ) ? __( 'All results →', 'abacus' ) : sprintf( __( 'Next %s results →', 'abacus' ), ucfirst( $type . 's' ) ); // Don't print empty markup if there's only one page. if ( $max_page < 2 ) return; $next_posts_link = ( intval($paged) + 1 <= $max_page ) ? '' . sprintf( __( '← Previous %s results', 'abacus' ), ucfirst( $type . 's' ) ) . '' : ' '; $prev_posts_link = ( $paged > 1 ) ? '' . $prev_label . '' : ' '; ?> is_search && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); } return $query; } add_filter( 'excerpt_more', 'abacus_excerpt_more' ); if ( ! function_exists( 'abacus_excerpt_more' ) ) { function abacus_excerpt_more( $more ) { $abacus_default_theme_options = abacus_default_theme_options(); return '…
' . abacus_sanitize_text( get_theme_mod( 'read_more_text', $abacus_default_theme_options['read_more_text'] ) ) . ' ' . get_the_title() . '
'; } } add_filter( 'the_content_more_link', 'abacus_remove_more_link_scroll' ); if ( ! function_exists( 'abacus_remove_more_link_scroll' ) ) { function abacus_remove_more_link_scroll( $link ) { return preg_replace( '|#more-[0-9]+|', '', $link ); } }