WordPress.org

Ready to get started?Download WordPress

Forums

Adding class to current page in wp_link_pages (2 posts)

  1. yans_fied
    Member
    Posted 1 year ago #

    We can pass some argument for wp_link_pages, including before pagination and after, but I can't find argument for adding content before and after "Current Page" , so we can't add class to current page.

    Currently the current page rendered without any HTML tag/rendered as plain text. I need to add extra HTML tag to current page like <span class="current">Page 1</span>

  2. LastForOne
    Member
    Posted 1 year ago #

    you can use WP-PageNavi plugin instead of hardcoding it into your theme, but here's a snippet from Bones The WordPress Starter Theme to hardcode the PageNavi with custom output, have a look.

    Paste: http://pastebin.com/udwKkV5h

    Peace,
    LastForOne

Topic Closed

This topic has been closed to new replies.

About this Topic