Saturday, May 21, 2016

WordPress get current page number in Pagination

WordPress Supports pagination and has default functions which can be used to display pagination. For Example: In Blog page pagination is displayed by default. But sometimes you needs to add pagination to a custom template. In Some scenarios we needs to get the current page number in the pagination.

Current page number in Pagination can be retrived in the following way.

<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
?>


Here $paged will contain the page number.

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...