WordPress.org

Ready to get started?Download WordPress

Forums

Styling the nextpage tags (7 posts)

  1. robertm
    Member
    Posted 6 years ago #

    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>
    </div>
  2. Jerry
    Member
    Posted 6 years ago #

    ??? 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>
  3. robertm
    Member
    Posted 6 years ago #

    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.

  4. Jerry
    Member
    Posted 6 years ago #

    By chance have you viewed http://codex.wordpress.org/Styling_Page-Links ?

    BTW I apologize for not reading your question correctly :D

  5. robertm
    Member
    Posted 6 years ago #

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

  6. Kafkaesqui

    Posted 6 years ago #

    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:

    http://www.szub.net/nada/nextpage.png

  7. 2is3
    Member
    Posted 5 years ago #

    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: http://www.flickr.com/photos/2is3/2984968936/

    <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>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.