Amit
Amit

Reputation: 7818

How to display post pagination in wordpress (if possible without a plugin)

My blog that runs on Wordpress has several pages of posts. I have the page navigation set up (so I have a link for "Older Entries" and "Newer Entries").

I was wondering if it's possible to do something like this:

1 | 2 | 3 | 4 ... 32 | Last Page

EDIT: Thanks to Adam, I replaced the wp_list_pages with the wp_link_pages function as follows:

            <?php $pageargs = array(
        'next_or_number'   => 'number'
        ); ?>
    <ul>
        <?php wp_link_pages( $pageargs ); ?> 
    </ul>

I also tried just the default:

<?php wp_link_pages(); ?>

However, it still doesn't work. I'm not getting post pagination. Any ideas?

Thanks, Amit

Upvotes: 1

Views: 2197

Answers (3)

markratledge
markratledge

Reputation: 17561

WordPress › WP-Paginate « WordPress Plugins does that kind of pagination.

Upvotes: 2

Adam
Adam

Reputation: 2180

I think wp_list_pages deals with listing content pages, whereas what you're looking for is wp_link_pages which provides pagination.

Hope that helps!

Upvotes: 2

ahmet2106
ahmet2106

Reputation: 5007

You are searching a PageNavigation?

There are so many Scripts for this, the most used one is: WP-PageNavi

It is really easy to implement. You only have to add:

 <?php wp_pagenavi(); ?>

this to your Template File(s).

Upvotes: -1

Related Questions