PluginProbe
Property Hive / 1.4.49
Property Hive v1.4.49
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / templates / search / result-count.php

result-count.php in Property Hive 1.4.49, at templates/search/result-count.php

33 lines 994 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Result Count
4 *
5 * Shows text: Showing x - x of x results
6 *
7 * @author PropertyHive
8 * @package PropertyHive/Templates
9 * @version 1.0.0
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
14 global $propertyhive, $wp_query;
15
16 ?>
17 <p class="propertyhive-result-count">
18 <?php
19 $paged = max( 1, $wp_query->get( 'paged' ) );
20 $per_page = $wp_query->get( 'posts_per_page' );
21 $total = $wp_query->found_posts;
22 $first = ( $per_page * $paged ) - $per_page + 1;
23 $last = min( $total, $wp_query->get( 'posts_per_page' ) * $paged );
24
25 if ( 1 == $total ) {
26 _e( 'Showing the single result', 'propertyhive' );
27 } elseif ( $total <= $per_page || -1 == $per_page ) {
28 printf( __( 'Showing %s properties', 'propertyhive' ), number_format($total) );
29 } else {
30 printf( _x( 'Showing %1$s–%2$s of %3$s properties', '%1$s = first, %2$s = last, %3$s = total', 'propertyhive' ), number_format($first), number_format($last), number_format($total) );
31 }
32 ?>
33 </p>