Counting Search results, and displaying the offset per page

I’m afraid you’re doing it a little bit wrong…

Here are the problems:

  1. post_count field contains the number of posts being displayed and not the offset.
  2. wp_count_posts returns the number of posts globally, not in current query (so it will not be true for queries that have some filters).
  3. echo $post_count; . '-' . $post_count; is not correct PHP code.

So how to do this?

All you need is the info from WP_Query:

<?php
    $first_post = absint( $wp_query->get('paged') - 1 ) * $wp_query->get('posts_per_page') + 1;
    $last_post = $first_post + $wp_query->post_count;
    $all_posts = $wp_query->found_posts;
?>
<p class="small text-uppercase">Showing <?php echo $first_post . '-' . $last_post; ?> of <strong><?php echo $all_posts; ?> items</strong></p>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)