Created
March 3, 2016 17:03
-
-
Save stephanieleary/bb47cb741639beb38389 to your computer and use it in GitHub Desktop.
Include number of search results in Genesis title
This file contains hidden or 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 | |
add_filter( 'genesis_search_title_text', 'my_search_title_text' ); | |
function my_search_title_text( $title ) { | |
global $wp_query; | |
$start = ( ( $wp_query->paged - 1 ) * $wp_query->posts_per_page ) + 1; | |
$end = $wp_query->paged * $wp_query->posts_per_page; | |
return sprintf( '%s (%d—%d of %d)', $title, $start, $end, $wp_query->found_posts ); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment