Title: current page php script
Last modified: August 19, 2016

---

# current page php script

 *  [sagive](https://wordpress.org/support/users/sagive/)
 * (@sagive)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/current-page-php-script/)
 * hey
 * I got this script
 *     ```
       <?php
       global $wp_query;
       $max_page = $wp_query->max_num_pages;
       $paged = intval(get_query_var('paged'));
       if(empty($paged) || $paged == 0) {
       	$paged = 1;
       }
       if ($max_page != 1) {
       ?>
       <table id="pagenav">
       	<tbody>
       		<tr valign="top">
                   <?php
       			if ($paged != 1) {
       			?>
                   <td class="b"><a href="<?php previous_posts() ?>"><span class="csb ch" style="width:44px;margin-left:auto"></span><div style="margin-right:8px">הקודם</div></a></td>
                   <?php } else { ?>
                   <td><span class="csb" style="background-position: -26px 0px; width: 18px"></span></td>
                   <?php } ?>
                   <td><span class="csb" style="background-position: -44px 0px; width: 16px"></span>1</td>
                   <?php if ($max_page > 1) { $count = 2; while ($count < $max_page) { $count++; ?>
                   <td><span class="csb" style="background-position: -60px 0px; width: 16px"></span><?php echo $count-1 ?></td>
                   <?php }} ?>
                   <td><span class="csb ch" style="background-position: -60px 0px; width: 16px"></span><?php echo $max_page ?></td>
                   <?php
       			if ($paged != $max_page) {
       			?>
                   <td class="b"><a href="<?php next_posts() ?>"><span class="csb ch" style="background-position: -76px 0px; width: 66px; margin-right: 34px"></span>הבא</a></td>
                   <?php } else { ?>
                   <td class="b"><span class="csb" style="background-position: -76px 0pt; width: 42px;"></span></td>
                   <?php } ?>
       	    </tr>
       	</tbody>
       </table>
       <?php } ?>
       ```
   
 * i want the pages/numbers being created to be linked
    and leading to the currect
   page number with out changing the design (as much as i can)..
 * any ideas anyone?
 * here is the link to the “under construction website”
    [http://israel-blog.co.il/seo/](http://israel-blog.co.il/seo/)
   pass: pass123
 * would apreciate your help 🙂

The topic ‘current page php script’ is closed to new replies.

## Tags

 * [current page](https://wordpress.org/support/topic-tag/current-page/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [sagive](https://wordpress.org/support/users/sagive/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/current-page-php-script/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
