Site icon Hip-Hop Website Design and Development

Present a web page counter for pagination

I presently have easy pagination arrange displaying the textual content older and newer. If one of many textual content is not wanted it show an ‘inactive’ model of it in order that the textual content does not disappear.

<?php if( get_next_posts_link() ) :?>
                <div id="next-post-link" class="post-pag flL"><?php next_posts_link( '<i class="icon-left-open-big"></i><span>Older</span>' );?></div>
            <?php else: ?>
                <div id="next-post-link" class="post-pag inactive flL"><i class="icon-left-open-big"></i><span>Older</span></div>
            <?php endif; ?>

            <?php if( get_previous_posts_link() ) :?>
                <div id="prev-post-link" class="post-pag flR"><?php previous_posts_link( '<span>Newer</span><i class="icon-right-open-big"></i>' );?></div>
            <?php else: ?>
                <div id="prev-post-link" class="post-pag inactive flR"><span>Newer</span><i class="icon-right-open-big"></i></div>
            <?php endif; ?>

That is working fantastic nevertheless I am struggling to realize a web page counter. I’ve checked out a number of questions on numbered pagination nevertheless it appears excessive for what I need. I am seeking to print the present web page that I am on and print the overall quantity of pages on a regular basis.

This picture ought to present what I imply higher:

That is my Question to date:

$current_page = get_query_var( 'paged' );
    $pages = $wp_query->max_num_pages;

    $args = array(
        'paged'=> $paged,
        'posts_per_page' => '2'
    );

    $wp_query = new WP_Query($args); 

    if ($wp_query->have_posts()) :