Completed
Push — master ( 556f73...911fab )
by Md. Mozahidur
02:37
created
functions.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -252,7 +252,9 @@  discard block
 block discarded – undo
252 252
      $showitems = ($range * 2)+1;  
253 253
  
254 254
      global $paged;
255
-     if(empty($paged)) $paged = 1;
255
+     if(empty($paged)) {
256
+     	$paged = 1;
257
+     }
256 258
  
257 259
      if($pages == '')
258 260
      {
@@ -267,8 +269,12 @@  discard block
 block discarded – undo
267 269
      if(1 != $pages)
268 270
      {
269 271
          echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>";
270
-         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
271
-         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
272
+         if($paged > 2 && $paged > $range+1 && $showitems < $pages) {
273
+         	echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";
274
+         }
275
+         if($paged > 1 && $showitems < $pages) {
276
+         	echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; Previous</a>";
277
+         }
272 278
  
273 279
          for ($i=1; $i <= $pages; $i++)
274 280
          {
@@ -278,8 +284,12 @@  discard block
 block discarded – undo
278 284
              }
279 285
          }
280 286
  
281
-         if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next &rsaquo;</a>";  
282
-         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
287
+         if ($paged < $pages && $showitems < $pages) {
288
+         	echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next &rsaquo;</a>";
289
+         }
290
+         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) {
291
+         	echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</a>";
292
+         }
283 293
          echo "</div>\n";
284 294
      }
285 295
 }
Please login to merge, or discard this patch.