I have a certain number of potential posts. We do not know how many there are, but the system is configured to display 12 pages. Below I would like it to display the number of pages.
So, if we get the messages:
<?php $pages = get_posts('category_name=news'); ?>
Now what we want to do is
- determine how many messages it found.
- divide this number by 12
- round this number to the nearest integer (UP never go down)
- divide this number by 1 and indicate how many times 1 goes into it.
- thus setting as many page numbers as necessary.
Ideas are to line up like 1 | 2 | 3 | 4 | 5 etc.
Any ideas?
source share