null, 'current_view' => 'list', 'show_grid' => true, 'show_list' => true, 'show_slider' => true, 'view_urls' => [], ] ); $properties_query = $args['properties_query']; $current_view = $args['current_view']; $found_posts = $properties_query instanceof \WP_Query ? (int) $properties_query->found_posts : 0; $show_grid = (bool) $args['show_grid']; $show_list = (bool) $args['show_list']; $show_slider = (bool) $args['show_slider']; $view_urls = is_array($args['view_urls'] ?? null) ? $args['view_urls'] : []; $has_view_toggle = $show_grid || $show_list || $show_slider; $showing_from = 0; $showing_to = 0; if ($properties_query instanceof \WP_Query && $found_posts > 0) { $paged = max(1, (int) $properties_query->get('paged')); $per_page = (int) $properties_query->get('posts_per_page'); $on_page = max(0, (int) $properties_query->post_count); if ($per_page < 1) { $showing_from = 1; $showing_to = $found_posts; } else { $showing_from = (($paged - 1) * $per_page) + 1; $showing_to = min($found_posts, $showing_from + $on_page - 1); } } ?>
0 && $showing_to > 0) : ?>