Support » Themes and Templates » Styling the nextpage tags

  • When using wp_link_pages is it possible to use CSS to make the current page’s link obvious? (eg. no href and a different style so the user knows which page she/he is viewing and doesn’t click it…exactly like the Codex plugin pages on this website).

    Here’s how I’ve done it before but I can’t see how to do this with WordPress:

    <div id="pagenav">
    <a href="#">1</a>
    <span class="current">2</span>
    <a href="#">3</a>
    <a href="#">4</a>
    <a href="#">5</a>
    <a href="#">6</a>
Viewing 6 replies - 1 through 6 (of 6 total)
  • ??? Are you using posts_nav_link() or your own coding, if you’re using the built in nav function it should look like so:

    <p id="pageNav">
        <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?></p>

    Correct me if I am doing something wrong here. I am using WP’s wp_link_pages function to break up long articles into multiple pages. ie. Page 1 of 6, page 2 of 6 etc.

    <?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); ?>

    This way if a long article is broken into, say, six pages ideally the viewer knows at a glance they are on page four:

    [1] [2] [3] 4 [5] [6]

    But unlike my diagram (or the Codex here), WordPress doesn’t seen to indicate the current page. It’s an identically styled link to itself.

    By chance have you viewed ?

    BTW I apologize for not reading your question correctly 😀

    Yes I did read it. I was hoping someone who understood this would tell me it was incomplete.

    For as long as I’ve used WordPress the ‘current’ page # displayed with wp_link_pages() does not appear as a link. For example, using 2.3.1 right now when I paginate a post through <!--nextpage--> I see:

    [1] [2] 3 [4]

    Where the bracketed numbers are links and the present page of the post I’m on (3) displays as just text. Here is a cropped image of this with my theme’s stylesheet:



    I totally know what you mean robertm, I would like to see a way to class the current page number. I mean heck, even these forums do it:

    View screen grab:

    <p id="pages"><span class='page-numbers current'>1</span>
    <a class='page-numbers' href='/support/forum/3/page/2'>2</a>
    <a class='page-numbers' href='/support/forum/3/page/3'>3</a>
    <span class='page-numbers dots'>...</span>
    <a class='page-numbers' href='/support/forum/3/page/3298'>3298</a>
    <a class='next page-numbers' href='/support/forum/3/page/2'>Next &raquo;</a>
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Styling the nextpage tags’ is closed to new replies.