-
-
Save billerickson/6771a74ee50455e66cc9e171282fba27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Search Heading | |
* | |
*/ | |
function ea_search_results_heading() { | |
global $wp_query; | |
$paged = get_query_var( 'paged') ? get_query_var( 'paged' ) : 1; | |
$per_page = get_query_var( 'posts_per_page' ); | |
$start = 1 + $per_page * ( $paged - 1 ); | |
$end = $start + $per_page - 1 > $wp_query->found_posts ? $wp_query->found_posts : $start + $per_page - 1; | |
$output = 'Showing ' . $start . '-' . $end . ' of ' . $wp_query->found_posts . ' results'; | |
echo '<div class="search-count">' . $output . '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment