WordPress.org

Ready to get started?Download WordPress

Forums

how to: show page number on homepage (2 posts)

  1. neologan
    Member
    Posted 2 years ago #

    How do you (what is the code) show the page number on the homepage? So if you are on page two, scrolling through posts, I want to make it say "page 2", and so on?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    try:

    <?php echo get_query_var('paged'); ?>

    or more refined:

    <?php echo 'page '.(get_query_var('paged') ? get_query_var('paged') : '1'); ?>

    or to show only on page 2 +:

    <?php echo (get_query_var('paged') ? 'page'.get_query_var('paged') : ''); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags