Support » Plugins » Index Pagination : counting pages

  • Hi guys,

    I’d like to print something like this in the Index Page (while the user is browsing the several pages of ‘old posts’ from the Index ):

    “you are in Page 2 of 25 pages” ?

    Or “you are in Page 2/25” ?

    I can count the total number of posts but I’m lost here 🙂
    Many thanks for any input.

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi


    Forum Moderator

    Could you retrieve the number of posts per page using get_option. Something like ceil(total number of posts / posts per page) should give you the total number of pages.

    Hi esmi, thanks for the info.

    But how would you apply the ceil function once you have the number of posts ? I’m just not familiar enough with PHP.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Index Pagination : counting pages’ is closed to new replies.