php - Custom Pagination Display Total Page Numbers Of Posts -


i trying custom pagination in wordpress not no how show page 1 of 7 example in css have defined.

you can see here : http://kvalixhu.digitalthinkersni.co.uk/blog/ @ bottom of page trying acheive.

i looking here @ codex couldnt find how page numbers can show 1/7 2/7 3/7 example ?

<div class="pagination"> <ul>     <li class="previous">         <a href="">&lt;</a>     </li>     <li class="number">         <a href="">1/7</a>     </li>     <li class="next">         <a href="">&gt;</a>     </li>     </ul> </div> 

i here dont tell me how total pages show have idea how achieve this.

you can current page in with:

$current_page = get_query_var( 'paged' ); 

total number of pages current query:

global $wp_query; $pages = $wp_query->max_num_pages; 

maybe must check article: how-to-add-wordpress-pagination-without-a-plugin


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -