Viewing 1 replies (of 1 total)
  • I would try to find a plugin that can do it for you. It’ll save you some time and hassle. It probably won’t do it automatically, so make sure you read the instructions.

    If you like to live dangerously (and who doesn’t), you could do something like:

    <?php
    $url = $_SERVER["REQUEST_URI"];
    $segments = explode('/', $url);
    $current_page_number = end($segments);
    
    <div id="nav_numbers">
        <?php for($i = 1; $i <= (ceil(wp_count_posts()->publish / get_option('posts_per_page'))); $i++) : ?>
            <?php $class = if($current_page_number == $i ? 'active' : '' ) ?>
            <a href="<?php get_site_url(); ?>/news/latest-news/page/<?=$i?>/" class="<?=$class?>">&nbsp;</a>
        <?php endfor; ?>
    </div>

    Best of luck!

Viewing 1 replies (of 1 total)

The topic ‘Page Numbers’ is closed to new replies.