Skip to content

Instantly share code, notes, and snippets.

View ibrahimkholil's full-sized avatar
🎯
Focusing

Ibrahim khalil ibrahimkholil

🎯
Focusing
  • Orangetoolz
  • House 77 (9th Floor), Road 13, Sector 10, Uttara, Dhaka -1230
  • X @IKholil
View GitHub Profile
@ibrahimkholil
ibrahimkholil / wp_user_query_pagination.php
Created April 4, 2023 09:55 — forked from mujahidi/wp_user_query_pagination.php
Pagination with WP_User_Query object
<?php
// number of users we want to show per page
$number = 10;
// to pinpoint the current pagination number
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// count the number of users that should be passed over in the pages (offset) – this will take effect at the second page onwards.
$offset = ($paged - 1) * $number;