title: Magento pagination - Page numbers not displaying correctly when records per page is 45
body: <p>I am dealing with a strange problem. In my product listing page, the pagination is not working properly. 
  I have a total of 187 items. In the pagination, the number of pages displayed is three. ie;   1,2,3
  When I select 45 number of records per page, and selecting the 4 th page , the items are loaded correctly, but the pagination links are still displayed as 1, 2, 3 instead of 2,3,4 .</p>
  
  <p>the template i am using is the frontend\mycompany\default\template\page/html/pager.phtml
  and the block is MageWorx_SeoSuite_Block_Page_Html_Pager .</p>
  
  <p>The pagination works without any problem for the number of records 15 and 30, the issue only appears when selecting 45 records per page.</p>
  
  <p>The content of pager.phtml is,</p>
  
  <pre><code>&lt;?php if($this-&gt;getCollection()-&gt;getSize()): ?&gt;
  
  &lt;?php if($this-&gt;getUseContainer()): ?&gt;
  &lt;div class="pager"&gt;
  &lt;?php endif ?&gt;
  
  &lt;?php if($this-&gt;getShowAmounts()): ?&gt;
  &lt;p class="amount"&gt;
      &lt;?php if($this-&gt;getLastPageNum()&gt;1): ?&gt;
          &lt;?php echo $this-&gt;__('Items %s to %s of %s total', $this-&gt;getFirstNum(), $this-&gt;getLastNum(), $this-&gt;getTotalNum()) ?&gt;
      &lt;?php else: ?&gt;
          &lt;strong&gt;&lt;?php echo $this-&gt;__('%s Item(s)', $this-&gt;getTotalNum()) ?&gt;&lt;/strong&gt;
      &lt;?php endif; ?&gt;
  &lt;/p&gt;
  &lt;?php endif ?&gt;
  
  &lt;?php if($this-&gt;getShowPerPage()): ?&gt;
  &lt;div class="limiter"&gt;
      &lt;label&gt;&lt;?php echo $this-&gt;__('Show') ?&gt;&lt;/label&gt;
      &lt;select onchange="setLocation(this.value)"&gt;
      &lt;?php foreach ($this-&gt;getAvailableLimit() as  $_key=&gt;$_limit): ?&gt;
          &lt;option value="&lt;?php echo $this-&gt;getLimitUrl($_key) ?&gt;"&lt;?php if($this-&gt;isLimitCurrent($_key)): ?&gt; selected="selected"&lt;?php endif ?&gt;&gt;
              &lt;?php echo $_limit ?&gt;
          &lt;/option&gt;
      &lt;?php endforeach; ?&gt;
      &lt;/select&gt; &lt;?php echo $this-&gt;__('per page') ?&gt;
  &lt;/div&gt;
  &lt;?php endif ?&gt;
  
  &lt;?php if($this-&gt;getLastPageNum()&gt;1): ?&gt;
  &lt;div class="pages"&gt;
  
    &lt;!--  &lt;strong&gt;&lt;?php echo $this-&gt;__('Page:') ?&gt;&lt;/strong&gt;--&gt;
      &lt;ol&gt;
      &lt;?php if (!$this-&gt;isFirstPage()): ?&gt;
          &lt;li&gt;
              &lt;a class="previous&lt;?php if(!$this-&gt;getAnchorTextForPrevious()): ?&gt; i-previous&lt;?php endif;?&gt;" href="&lt;?php echo $this-&gt;getPreviousPageUrl() ?&gt;" title="&lt;?php echo $this-&gt;__('Previous') ?&gt;"&gt;
                  &lt;?php if(!$this-&gt;getAnchorTextForPrevious()): ?&gt;
                      &lt;img src="&lt;?php echo $this-&gt;getSkinUrl('images/pager_arrow_left.gif') ?&gt;" alt="&lt;?php echo $this-&gt;__('Previous') ?&gt;" class="v-middle" /&gt;
                  &lt;?php else: ?&gt;
                      &lt;?php echo $this-&gt;getAnchorTextForPrevious() ?&gt;
                  &lt;?php endif;?&gt;
              &lt;/a&gt;
          &lt;/li&gt;
      &lt;?php endif;?&gt;
  
      &lt;?php if ($this-&gt;canShowFirst()): ?&gt;
          &lt;li&gt;&lt;a class="first" href="&lt;?php echo $this-&gt;getFirstPageUrl() ?&gt;"&gt;1&lt;/a&gt;&lt;/li&gt;
      &lt;?php endif;?&gt;
  
      &lt;?php if ($this-&gt;canShowPreviousJump()): ?&gt;
          &lt;li&gt;&lt;a class="previous_jump" title="" href="&lt;?php echo $this-&gt;getPreviousJumpUrl() ?&gt;"&gt;...&lt;/a&gt;&lt;/li&gt;
      &lt;?php endif;?&gt;
  
      &lt;?php $i=0;foreach ($this-&gt;getFramePages() as $_page):if($i&lt;3): ?&gt;
          &lt;?php if ($this-&gt;isPageCurrent($_page)): ?&gt;
              &lt;li class="current"&gt;&lt;?php echo $_page ?&gt;&lt;/li&gt;
          &lt;?php else: ?&gt;
              &lt;li&gt;&lt;a href="&lt;?php echo $this-&gt;getPageUrl($_page) ?&gt;"&gt;&lt;?php echo $_page ?&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;?php endif;?&gt;
      &lt;?php $i++;endif; endforeach;?&gt;
  
  
      &lt;?php if ($this-&gt;canShowNextJump()): ?&gt;
          &lt;li&gt;&lt;a class="next_jump" title="" href="&lt;?php echo $this-&gt;getNextJumpUrl() ?&gt;"&gt;...&lt;/a&gt;&lt;/li&gt;
      &lt;?php endif;?&gt;
  
      &lt;?php if ($this-&gt;canShowLast()): ?&gt;
        &lt;li&gt;&lt;a class="last" href="&lt;?php echo $this-&gt;getLastPageUrl() ?&gt;"&gt;&lt;?php echo $this-&gt;getLastPageNum() ?&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;?php endif;?&gt;
  
      &lt;?php if (!$this-&gt;isLastPage()): ?&gt;
          &lt;li&gt;
              &lt;a class="next&lt;?php if(!$this-&gt;getAnchorTextForNext()): ?&gt; i-next&lt;?php endif; ?&gt;" href="&lt;?php echo $this-&gt;getNextPageUrl() ?&gt;" title="&lt;?php echo $this-&gt;__('Next') ?&gt;"&gt;
                  &lt;?php if(!$this-&gt;getAnchorTextForNext()): ?&gt;
                      &lt;img src="&lt;?php echo $this-&gt;getSkinUrl('images/pager_arrow_right.gif') ?&gt;" alt="&lt;?php echo $this-&gt;__('Next') ?&gt;" class="v-middle" /&gt;
                  &lt;?php else: ?&gt;
                      &lt;?php echo $this-&gt;getAnchorTextForNext() ?&gt;
                  &lt;?php endif;?&gt;
              &lt;/a&gt;
          &lt;/li&gt;
      &lt;?php endif;?&gt;
      &lt;/ol&gt;
  
  &lt;/div&gt;
  &lt;?php endif; ?&gt;
  
  &lt;?php if($this-&gt;getUseContainer()): ?&gt;
  &lt;/div&gt;
  &lt;?php endif ?&gt;
  </code></pre>
  
  
  
  <p>I am a beginner to magento .   </p>