Forums

more control over wp_link_pages? (4 posts)

  1. sgatz
    Member
    Posted 2 years ago #

    Hi,

    I'm looking for more control over wp_link pages. Namely, I want pagination to look more like it looks right here on these forums (like what appears at the top/bottom of lists of posts).

    Something like
    <prev 1 2 3 4 5 Next>

    So I want to show both next AND number in next_or_number and I want to be able to wrap a different style around the selected number so it can highlight another color.

    any advice as to how to do this?

  2. ippo
    Member
    Posted 2 years ago #

    Here's the code that I use to display that. Be warned, it's ugly. If you break it up into pieces, you can see what I did.

    wp_link_pages(array('before' => '', 'after' => '','next_or_number' => 'next', 'nextpagelink' => '', 'previouspagelink' => '<Prev '));
    wp_link_pages(array('before' => '','after'=>'','next_or_number' => 'number'));
    wp_link_pages(array('before' => '', 'after' => '','next_or_number' => 'next', 'nextpagelink' => ' Next>', 'previouspagelink' => ''));

  3. sgatz
    Member
    Posted 2 years ago #

    ippo, thanks. I'll give that a try. it seems quite smart (and why didn't I think of that).

    --scott

  4. sgatz
    Member
    Posted 2 years ago #

    I tried this and it is very close.

    The one caveat (for people reading) is that just putting '' as a value in nextpagelink or previouspagelink only removes the text, it doesn't remove the link. So you get a in your html. since I style links, it shows up in my theme. I'll have to play with it a bit to remove that, but I think I can make it work.

Topic Closed

This topic has been closed to new replies.

About this Topic