title: How to hide some pagination numbers in between and keep the first 3 page numbers and last page number
body: <p>The below php code results pagination as 1, 2, 3, 4, 5, 6 , ...</p>
  <p>I would like to get the result as 1, 2, 3, ... ,10</p>
  <pre><code>    if ( is_array( $pages ) ) {
          $paged = ( get_query_var( 'paged' ) == 0 ) ? 1 : get_query_var( 'paged' );
          echo '&lt;ul class=&quot;page-numbers nav-pagination links text-center&quot;&gt;';
          foreach ( $pages as $page ) {
              $page = str_replace( 'page-numbers', 'page-number', $page );
              echo '&lt;li&gt;' . $page . '&lt;/li&gt;';
          }
          echo '&lt;/ul&gt;';
      }
  ?&gt;
  </code></pre>